I have used GNU make from the Rtools installation for convenient access to GNU make and other linux programs that don't come with git bash on Windows, in an environment where installing my own programs is not permitted.
When running R scripts from a makefile in Rtools 40+, the .libPaths do not initialize correctly.
Here is the makefile, trimmed down to only show the relevant issue:
all: checklib
checklib:
Rscript -e ".libPaths()"
When I run with the older Rtools 35 version, I get the expected output:
$ /c/Rtools/bin/make
Rscript -e ".libPaths()"
[1] "C:/Users/AlecW/AppData/Local/R/win-library/4.3"
[2] "C:/Program Files/R/R-4.3.0/library"
When I run with rtools43 (or rtools40, for that matter) this is the output:
$ /c/rtools43/usr/bin/make
Rscript -e ".libPaths()"
[1] "C:/Program Files/R/R-4.3.0/library"
Note that the path to the user library at Appdata
is not present. The install location at AppData is the default location for R to install user packages, and I have not edited the Rprofile.site or user .Rprofile files to alter the library paths. The result is the same if I start Rscript
with --no-site-file --no-environ --no-init-file
.
I am running R version 4.3.0.