r-lib / devtools

Tools to make an R developer's life easier
https://devtools.r-lib.org
Other
2.39k stars 760 forks source link

`devtools::install` in a "custom" library folder #2432

Closed stla closed 2 years ago

stla commented 2 years ago

o Is your feature request related to a problem? Please describe: I want to install my package in a particular library folder. I tried to use the lib argument in devtools::install (expectedly passed to remotes::install_deps then passed to utils::install.packages) but that didn't work (I got a message such as "invalid argument: lib", or "unused argument: lib", I don't remember).

o Describe the solution you'd like: I want a lib argument to give the path of the desired installation folder..

o Describe alternatives you've considered: Since lib has not worked, I built the source package and I installed it with utils::install.packages. But I would prefer devtools::install(quick = TRUE).

o Additional context: R-4.2.0, Windows 10.

hadley commented 2 years ago

We'd recommend withr::with_libpaths() for this purpose.

stla commented 2 years ago

Ah ok, thank you.