Steve Haroz
2021-Jul-24 20:53 UTC
[Rd] Feature request: Change default library path on Windows
Hello, I'd like to propose moving the default library install location on Windows from: %USERPROFILE%/Documents/R to some other location such as: %USERPROFILE%/R For many users the Documents folder is backed up or synchronized. Installing libraries thrashes Documents, and it causes synchronization issues with Dropbox (I confirm this one), OneDrive, and users with Network IT policies. The vast majority of R users won't touch that folder and don't need it backed up. And, its contents are not really "documents". There are many blog posts and websites with people complaining about it or offering workarounds that involve hand editing setting and environment files, which reduces R's usability and accessibility. * https://community.rstudio.com/t/help-regarding-package-installation-renviron-rprofile-r-libs-r-libs-site-and-r-libs-user-oh-my/13888/5 * https://accelebrate.com/library/how-to-articles/r-rstudio-library * https://community.rstudio.com/t/r-studio-library-installation-directory/30725/2 * https://twitter.com/sharoz/status/1418712098444546057 * https://twitter.com/JoeHilgard/status/1419025358070878210 This change should not interfere with any project environment managers like renv. It should just change the global default for Windows R users. Also, I believe that on Mac it is not in Documents, but it's in the equivalent of %USERPROFILE%/R. Thanks, Steve Haroz
Dirk Eddelbuettel
2021-Jul-24 22:56 UTC
[Rd] Feature request: Change default library path on Windows
On 24 July 2021 at 15:53, Steve Haroz wrote: | I'd like to propose moving the default library install location on Windows from: | %USERPROFILE%/Documents/R | to some other location such as: | %USERPROFILE%/R Can you not set .Library.site in R_HOME/etc/Rprofile.site (or maybe setting R_LIBS_SITE either in R_HOME/etc/Renviron.site, or system-wide as an env variable so that you do not have to copy R_HOME/etc/Renviron.site once you upgrade R). See 'R Installation and Administration: 6.2 Managing libraries' for more: https://cran.r-project.org/doc/manuals/r-release/R-admin.html#Managing-libraries Dirk -- https://dirk.eddelbuettel.com | @eddelbuettel | edd at debian.org
Jeroen Ooms
2021-Jul-25 09:09 UTC
[Rd] Feature request: Change default library path on Windows
On Sun, Jul 25, 2021 at 12:15 AM Steve Haroz <steve.haroz at gmail.com> wrote:> > Hello, > > I'd like to propose moving the default library install location on Windows from: > %USERPROFILE%/Documents/R > to some other location such as: > %USERPROFILE%/R > > For many users the Documents folder is backed up or synchronized. > Installing libraries thrashes Documents, and it causes synchronization > issues with Dropbox (I confirm this one), OneDrive, and users with > Network IT policies. > > The vast majority of R users won't touch that folder and don't need it > backed up. And, its contents are not really "documents".I very much support this request. R's behavior of defaulting HOME to an unusual (legacy) directory is also a source of bugs and interoperability problems: R packages that interface c/c++ libraries that require a user config file (libssh, libgit2, etc) sometimes cannot find the user config because it gets stored on a different location than expected. A good example is 'git'. The 'git for windows' command line utility stores my user config in C:\users\Jeroen\.gitconfig. However, for R packages that link to libgit2 (e.g. git2r, gert) the user config gets loaded/stored from C:\users\Jeroen\Documents\.gitconfig because libgit2 inherits the R home directory. Having 2 different git configurations is obviously confusing for users. Another problem is that when you start R from "windows bash" or the msys2 shell (including "git for windows" or rtools40), the "~" directory is different than in RGui. This is because these shells do set the HOME variable (to the usual value), and R inherits that. For example: when I start R in RGui for Windows I see: > normalizePath("~") [1] "C:\\Users\\jeroen\\Documents" But when I start R or Rterm from the "git for windows" shell we get: > normalizePath("~") [1] "C:\\Users\\jeroen" An ambiguous home directory is obviously going to break R code that refers to paths in your home. Because these problems affect all Windows users, I think the benefits of fixing the default behavior easily outweigh the backward-compatibility and "there is a documented workaround" arguments.
Gabor Grothendieck
2021-Jul-25 14:16 UTC
[Rd] Feature request: Change default library path on Windows
At the very least it would be nice if there were a function that displays all the locations/paths currently being used in R. On Sat, Jul 24, 2021 at 6:15 PM Steve Haroz <steve.haroz at gmail.com> wrote:> > Hello, > > I'd like to propose moving the default library install location on Windows from: > %USERPROFILE%/Documents/R > to some other location such as: > %USERPROFILE%/R > > For many users the Documents folder is backed up or synchronized. > Installing libraries thrashes Documents, and it causes synchronization > issues with Dropbox (I confirm this one), OneDrive, and users with > Network IT policies. > > The vast majority of R users won't touch that folder and don't need it > backed up. And, its contents are not really "documents". > > There are many blog posts and websites with people complaining about > it or offering workarounds that involve hand editing setting and > environment files, which reduces R's usability and accessibility. > * https://community.rstudio.com/t/help-regarding-package-installation-renviron-rprofile-r-libs-r-libs-site-and-r-libs-user-oh-my/13888/5 > * https://accelebrate.com/library/how-to-articles/r-rstudio-library > * https://community.rstudio.com/t/r-studio-library-installation-directory/30725/2 > * https://twitter.com/sharoz/status/1418712098444546057 > * https://twitter.com/JoeHilgard/status/1419025358070878210 > > This change should not interfere with any project environment managers > like renv. It should just change the global default for Windows R > users. > Also, I believe that on Mac it is not in Documents, but it's in the > equivalent of %USERPROFILE%/R. > > Thanks, > Steve Haroz > > ______________________________________________ > R-devel at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel-- Statistics & Software Consulting GKX Group, GKX Associates Inc. tel: 1-877-GKX-GROUP email: ggrothendieck at gmail.com