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

Feature request: check for multiple .Renviron files and throw a warning if found #1983

Closed
jmb01 opened this issue Apr 17, 2024 · 1 comment
Closed
Labels
reprex needs a minimal reproducible example

Comments

@jmb01
Copy link

jmb01 commented Apr 17, 2024

It has been noted (e.g., here) that on Windows it is possible for R and RStudio to check for .Renviron in different places, causing confusion when changes are made via edit_r_environ() and then don't take effect upon restart.

It would be helpful to check for the presence of .Renviron in both locations and to throw a warning if a version is found in a location other than the one being edited.

@jennybc
Copy link
Member

jennybc commented Jun 26, 2024

I'm sort of skeptical of this:

on Windows it is possible for R and RStudio to check for .Renviron in different places

In particular, I'm doubtful RStudio has anything to do with it. Locating and loading .Renviron should be just an R matter, regardless of whether the R session is associated with RStudio or not.

But it is true that R's notion of the user's home directory on Windows is kind of confusing and regrettable. This situation is described in the docs for fs::path_home_r():

https://fs.r-lib.org/reference/path_expand.html

I suspect that whatever problem inspired this issue is more likely to have that situation as its root cause.

But I'm also not sure exactly what the ask for usethis is, i.e. usethis doesn't so any sort of "health check" of this sort of thing, especially unsolicited. AFAIK usethis itself is careful to build the correct path for .Renviron, including on Windows.

@jennybc jennybc added the reprex needs a minimal reproducible example label Jun 26, 2024
@jennybc jennybc closed this as not planned Won't fix, can't repro, duplicate, stale Jul 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
reprex needs a minimal reproducible example
Projects
None yet
Development

No branches or pull requests

2 participants