I'm the faculty member in my department who advises our IT staff on the details of installing R for students and faculty on our Windows 7 lab network. We are about to upgrade from R 3.1.1 to R 3.2.1, and once that is done, this version of R and all installed packages will be frozen in the image that appears in C:/Program Files/R/R-3.2.1/ on every lab computer, and this image is refreshed on each computer at each new login. Every user has a persistent home directory across all university lab computers, typically their F:/ drive (students) and/or X:/ drive (faculty). I need to give instructions to our IT staff for how to arrange for a personal library, say F:/~R/library to be be set automatically, and included in .libPaths() so that install.packages() and update.packages() will work using that path. At present, there is no file R_HOME/etc/Renviron.site and R_HOME/etc/Rprofile.site is the vanilla version with everything commented out, including # set a site library # .Library.site <- file.path(chartr("\\", "/", R.home()), "site-library") Environmental variables set for users include HOMEDRIVE=F: HOMEPATH=\ HOMESHARE=\\vfadmin.yorku.yorku.ca\HH\HOME\friendly with the latter mapped to the X: drive What is the code to be added to Rprofile.site to make this work? thanks, -Michael -- Michael Friendly Email: friendly AT yorku DOT ca Professor, Psychology Dept. & Chair, Quantitative Methods York University Voice: 416 736-2100 x66249 Fax: 416 736-5814 4700 Keele Street Web:http://www.datavis.ca Toronto, ONT M3J 1P3 CANADA
Just add the line R_LIBS_SITE=F:/R/library to the file R_HOME/etc/x64/Renviron.site Best, Uwe Ligges On 28.07.2015 15:53, Michael Friendly wrote:> I'm the faculty member in my department who advises our IT staff on the > details of installing R for > students and faculty on our Windows 7 lab network. We are about to > upgrade from R 3.1.1 to > R 3.2.1, and once that is done, this version of R and all installed > packages will be frozen in the > image that appears in C:/Program Files/R/R-3.2.1/ on every lab computer, > and this image is > refreshed on each computer at each new login. > > Every user has a persistent home directory across all university lab > computers, typically their > F:/ drive (students) and/or X:/ drive (faculty). I need to give > instructions to our IT staff for how to > arrange for a personal library, say > F:/~R/library > to be be set automatically, and included in .libPaths() so that > install.packages() and update.packages() > will work using that path. > > At present, there is no file R_HOME/etc/Renviron.site and > R_HOME/etc/Rprofile.site is the vanilla > version with everything commented out, including > # set a site library > # .Library.site <- file.path(chartr("\\", "/", R.home()), "site-library") > > Environmental variables set for users include > HOMEDRIVE=F: > HOMEPATH=\ > HOMESHARE=\\vfadmin.yorku.yorku.ca\HH\HOME\friendly > with the latter mapped to the X: drive > > What is the code to be added to Rprofile.site to make this work? > > thanks, > -Michael > > >
On 7/28/2015 1:32 PM, Uwe Ligges wrote:> Just add the line > > R_LIBS_SITE=F:/R/library > > to the file R_HOME/etc/x64/Renviron.siteThanks, Uwe I have no way to test this and our IT people who do the installation know nothing of R, so follow-up questions: * There is no R_HOME/etc/x64/Renviron.site file, but there is a R_HOME/etc/Rprofile.site I can modify and ask them to install. Would the equivalent in Rprofile.site be Sys.setenv(R_LIBS_SITE="F:/R/library") * Does this require that the R_LIBS_SITE folder exist and be writable by the user? Here is what I see in the current version: .libPaths(), the library trees where R looks for packages gives: [1] "G:/uitapps/HEBB_R_LIB2/library" [2] "C:/Program Files/R/R/R-3.1.1/library" If I try to install a new package, e.g., install.packages("rockchalk") I get "G:/uitapps/HEBB_R_LIB2/library is not writeable. Use a personal library instead?", followed by a popup window, "Create ~R/library? (y/n)" This then installs the package, but to "C:/Users/friendly/Desktop/~R/library". In the current login session, .libPaths() will then have this path, so in a new R session, load(rockchalk) will work. However, once I logout, all that disappears, so I have to start over again to install or update a package. -- Michael Friendly Email: friendly AT yorku DOT ca Professor, Psychology Dept. & Chair, Quantitative Methods York University Voice: 416 736-2100 x66249 Fax: 416 736-5814 4700 Keele Street Web:http://www.datavis.ca Toronto, ONT M3J 1P3 CANADA