[R] update.packages with UNC library path

Keith Jewell k.jewell at campden.co.uk
Fri Feb 26 16:36:01 CET 2010


Hi all,

I hit a small snag. Here is my workaround (copied verbatim from my aide 
memoire) in case it helps others. (or anyone knows a better way... ;-)

Best regards,

Keith Jewell.
------------------------
The site library file is defined (in Renviron.site 
R_LIBS_SITE=//Server02/stats/R/library/%v) via a UNC name something like 
"//Server02/stats/R/library/2.10".

As of now [Feb 2010, R version 2.10.1 (2009-12-14)] the menu Packages|Update 
Packages... [=update.packages(ask='graphics')] fails at the last step when 
it can't copy files to a directory named like that. It works if the site 
library is defined via a mapped drive like "L:\\R\\library\\2.10", but we 
don't want to require all users to have this drive mapped. The workaround is 
thus:

In order to update packages:

a) have an appropriate mapped drive (e.g. Stats on 'server02')

b) start R-Gui from that mapped drive. This will give the site library via 
the UNC and the base library via the mapped drive thus:
> .libPaths()
[1] "//Server02/stats/R/library/2.10" "L:/R/R-Current/library"

c) use .LibPaths(new= ) to add the drive mapped path to the beginning of the 
list
> .libPaths(new=choose.dir()) # navigate to folder on mapped drive
> .libPaths()
[1] "L:\\R\\library\\2.10"            "//Server02/stats/R/library/2.10" 
"L:/R/R-Current/library"

update.packages(ask='graphics') will now work



More information about the R-help mailing list