[R] Upgrading R means I lose my packages

Leon Yee yee.leon at gmail.com
Fri Aug 29 09:30:43 CEST 2008


In my situation under windows xp, after I setting the environment 
variable R_LIBS, neither Rgui.exe nor Rterm.exe under cmd.exe doesn't 
know the existence of R_LIBS.

After I enter the R interface, I find .libPaths() can add a new location 
for installed packages:
 > .libPaths("d:/progra~1/R/Rlibs")
 > .libPaths()
[1] "d:/progra~1/R/Rlibs"            "D:/PROGRA~1/R/R-27~1.2/library"

Then the install.packages will install the packages into the first 
directory. But after I restart R, I have to set it again. I cannot find
some configuration file to set it permanently.

Regards,
Leon


ONKELINX, Thierry wrote:
> On a windows machine you get the same problem. Useless one uses tha same
> trick as Rolf suggested: don't install the packages in the default
> directory and set R_LIBS to that directory. Then all you need to do
> after an upgrade is to set R_LIBS in the new version and run
> update.package(checkBuilt = TRUE). Given Rolf's suggestion I suppose
> this trick will work on a Mac too.
> 
> HTH,
> 
> Thierry
> 
> 
> ------------------------------------------------------------------------
> ----
> ir. Thierry Onkelinx
> Instituut voor natuur- en bosonderzoek / Research Institute for Nature
> and Forest
> Cel biometrie, methodologie en kwaliteitszorg / Section biometrics,
> methodology and quality assurance
> Gaverstraat 4
> 9500 Geraardsbergen
> Belgium
> tel. + 32 54/436 185
> Thierry.Onkelinx at inbo.be
> www.inbo.be
> 
> To call in the statistician after the experiment is done may be no more
> than asking him to perform a post-mortem examination: he may be able to
> say what the experiment died of.
> ~ Sir Ronald Aylmer Fisher
> 
> The plural of anecdote is not data.
> ~ Roger Brinner
> 
> The combination of some data and an aching desire for an answer does not
> ensure that a reasonable answer can be extracted from a given body of
> data.
> ~ John Tukey
> 
> 
> 
> 	I'm not sure --- I find Mac OS very confusing.  But I have the 
> ***impression*** that
> 	(on my system) by default packages get installed into
> 
> 		~/Library/R/2.7/library
> 
> 	i.e. into a library inside the directory tree rooted in my login
> 
> directory.
> 
> 	I don't use this --- I've created my own library ~/Rlib and have
> 	set up an environment variable to point to it.
> 
> 	(This works properly only if you start R from the command line;
> for
> 	reasons I don't understand if you start R by clicking on the
> icon
> 	then R doesn't know about the R_LIBS environment variable.  But
> since
> 	all civilized people start R from the command line .....)
> 
> 	I have no idea why youse guys' systems would eschew using
> ~/Library/
> <whatever>.
> 
> 		cheers,
> 
> 			Rolf Turner
>



More information about the R-help mailing list