Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Complete path for documentPath() #312

Closed
LuisLauM opened this issue Dec 16, 2024 · 4 comments
Closed

Complete path for documentPath() #312

LuisLauM opened this issue Dec 16, 2024 · 4 comments

Comments

@LuisLauM
Copy link

It is just a suggestion, but I think it would be good to have an argument in documentPath that allows to have the complete path directory (and not only the referential, which starts with ~). Currently, it is necessary to use external packages to achieve this in RStudio.

@kevinushey
Copy link
Contributor

Can't you just use path.expand() or normalizePath() to expand the path after you retrieve it?

@LuisLauM
Copy link
Author

LuisLauM commented Dec 16, 2024

Hi.

Yes, indeed, both functions help me to return what I was looking for. However, I don't understand why when I try to render the following Quarto file, it only works when I use the this.path tool. When I try the rstudioapi tool it tells me that I am not running RStudio.

this.path::this.path()  # It works
path.expand(rstudioapi::documentPath())  # It does not work

Image

@kevinushey
Copy link
Contributor

Sorry, but you can't use rstudioapi in this way -- Quarto runs in a context disconnected from RStudio and so doesn't know the file path here. In general, rstudioapi functions are only available within interactive RStudio R sessions.

@LuisLauM
Copy link
Author

Oh, I see, so for these cases it is better to use this.path for the moment. Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants