-
Notifications
You must be signed in to change notification settings - Fork 1
Always overwrites R_LIBS_SITE even when site-library exists under R_HOME #86
Description
arf currently seems to unconditionally set R_LIBS_SITE to the $(R_HOME)/library directory, even if a site-library subdirectory already exists under R_HOME.
However, this behavior appears to differ slightly from base R's initialization logic as described in ?base::libPaths:
First,
.Library.siteis initialized fromR_LIBS_SITE. If this is unset or empty, the ‘site-library’ subdirectory ofR_HOMEis used. Only directories which exist at the time of initialization are retained. Then,.libPaths()is called with the combination of the directories given byR_LIBSandR_LIBS_USER. By defaultR_LIBSis unset, and ifR_LIBS_USERis unset or empty, it is set to directory ‘R/R.version$platform-library/x.y’ of the home directory on Unix-alike systems (or ‘Library/R/m/x.y/library’ for CRAN macOS builds, with mSys.info()["machine"]) and ‘R/win-library/x.y’ subdirectory ofLOCALAPPDATAon Windows, for R x.y.z.
In practice, some R environments do provide a site-library directory under R_HOME even without any explicit configuration. For example, the R distribution installed via Scoop on Windows includes a site-library directory linked to another persisted location.
It seems that arf currently ignores this existing site-library and overwrites R_LIBS_SITE regardless of the directory structure. It would be helpful if arf could respect the default R behavior and detect whether site-library already exists before setting R_LIBS_SITE.
Session Information
arf version: 0.2.2
OS: windows (x86_64)
Config file: ~\AppData\Roaming\arf\arf.toml (not found, using defaults)
R version: 4.5.2
R_HOME: ~\scoop/apps/r/current
R source: PATH
rig: not installed
air: not installed
Current mode: R
R history: ~\AppData\Roaming\arf\history\r.db
Shell history: ~\AppData\Roaming\arf\history\shell.db
## Environment Variables
R_LIBS_USER: ~\AppData\Local/R/win-library/4.5
R_LIBS_SITE: ~\scoop\apps\r\current\library