-
Notifications
You must be signed in to change notification settings - Fork 153
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
Option to change renv folder location #472
Comments
Can you expand on why you want to change the location of the The main challenge here is the
and the path in the auto-loader needs to be "stable"; e.g. it needs to be able to find the activate script without |
I generally use R as part of a larger project that does separate analyses in Stata. My Stata libraries are kept in a subfolder, What I would like is the ability to store |
Thanks for the clarification. We could do this, but I think there's a bunch of things that would have to be done. Here are the places where we make use of the
We'd likely want to add a configuration option |
I've made some changes in the development version of
If you can, please give it a try and let me know if you run into any trouble. |
I gave it a quick try and ran into a few problems.
I confirmed that Here is sample code # Project folder location
MyProject <- Sys.getenv(c("MyProject"))
# Install development version of renv
library(devtools)
install_github("rstudio/renv")
# Disable autoloader, set lockfile path
RENV_CONFIG_AUTOLOADER_ENABLED = FALSE
RENV_PATHS_LOCKFILE <- paste0(MyProject,'/scripts/libraries')
# Error: refusing to initialize project in home directory -- use renv::init(force = TRUE) to override
renv::init(bare = TRUE, force = TRUE)
renv::install("[email protected]")
renv::snapshot() |
These need to be set as environment variables. For example:
I see, at the end:
Note that if you want |
A more complete solution changing both the
|
The article at https://rstudio.github.io/renv/reference/paths.html does not mention I'm also using it for a monorepo setup. I think it would be quite useful to write a vignette on a monorepo setup. I work on a proprietary codebase (we opensource what we can though) and a monorepo is just superiour layout to having many small packages, which when change necessitate updates to all the other packages. It's really just a single "solution" split into smaller modules for some operations reasons. |
We frequently are in a situation in which the same directory might be mounted as a SMB share on Mac, or it might be accessed via a number of different virtual Linux systems (a virtual machine with gui environment, or on a cluster). The binaries being compiled won't be cross-compatible. It seems like there should be a relatively simple way to (1) check the OS/server-name etc. and then (2) load the appropriate library folder (assuming that the same package versions are available across OS's). Is there a vignette or documentation on how that might be achieved reliably and with little hassle? Which environment variables would have to be set? |
@jacob-lee can you elaborate?
and you should see similar OS-specific components for other platforms. |
I am running into a similar issue and would appreciate knowing what the current solution is:
If I understand correctly (from [https://github.com//issues/1757]), one solution would be to create a new renv project in the destination location, replace its |
It would be nice to allow the user to specify the location of the /renv folder and the renv.lock file. For example, rather than having these items located in the root folder, I might instead want to locate them in a /libraries subfolder.
The text was updated successfully, but these errors were encountered: