Change path.expand location (Win 7)
To persistently reset the directory that "~"
resolves to for all users, put the following in the file Renviron.site
, located in $RHOME/etc/Renviron.site
:
R_USER="C:/Users/trinker"
(If the file is not already there, you can just create it yourself.)
If a computer supports multiple R users, and each wants to set their own R_USER
location, each can put the following in their own ".Rprofile"
file:
Sys.setenv(R_USER = "C:/Users/trinker")
".Rprofile"
is looked for in the user's home directory, which is returned by typing Sys.getenv("HOME")
. See ?Startup
and the R for Windows FAQ for more details.
(Thanks to @Dason for pointing out the .Rprofile
option.)