[R] How to reset libPaths for root
Prof Brian Ripley
ripley at stats.ox.ac.uk
Thu Feb 10 22:59:29 CET 2011
See ?.libPaths : as so often, all that is needed is attentive reading
of the documentation:
The library search path is initialized at startup from the
environment variable ‘R_LIBS’ (which should be a colon-separated
list of directories at which R library trees are rooted) followed
by those in environment variable ‘R_LIBS_USER’. Only directories
which exist at the time will be included.
By default ‘R_LIBS’ is unset, and ‘R_LIBS_USER’ is set to
directory ‘R/R.version$platform-library/x.y’ of the home directory
(or ‘Library/R/x.y/library’ for Mac OS X AQUA builds), for R
x.y.z.
Answer: set R_LIBS_USER or delete
/root/R/x86_64-pc-linux-gnu-library/2.12
On Thu, 10 Feb 2011, Juergen Rose wrote:
> High,
>
> on all of my computers the first entry in libPaths for root
> was /usr/lib64/R/library or /usr/lib/R/library. Now it change at one
> (lynx) anyway to
>
> root at lynx:/root(2)# R
>
> R version 2.12.1 (2010-12-16)
> Copyright (C) 2010 The R Foundation for Statistical Computing
> ISBN 3-900051-07-0
> Platform: x86_64-pc-linux-gnu (64-bit)
>
> R is free software and comes with ABSOLUTELY NO WARRANTY.
> You are welcome to redistribute it under certain conditions.
> Type 'license()' or 'licence()' for distribution details.
>
> R is a collaborative project with many contributors.
> Type 'contributors()' for more information and
> 'citation()' on how to cite R or R packages in publications.
>
> Type 'demo()' for some demos, 'help()' for on-line help, or
> 'help.start()' for an HTML browser interface to help.
> Type 'q()' to quit R.
>
>> .libPaths()
> [1] "/root/R/x86_64-pc-linux-gnu-library/2.12"
> [2] "/usr/lib64/R/library"
>
> If I try to install packages with:
>
> install.packages(something)
>
> it goes to /root/R/x86_64-pc-linux-gnu-library/2.12/ and not as
> expected to /usr/lib64/R/library.
>
> If I do .libPaths("/usr/lib64/R/library") I can temporarily reset
> libPaths to expected value, but after the next start of R I have
> again /root/R/x86_64-pc-linux-gnu-library/2.12 as first entry in
> libPaths:
>
>
>> .libPaths("/usr/lib64/R/library")
>> .libPaths()
> [1] "/usr/lib64/R/library"
>>
> Save workspace image? [y/n/c]: y
> [1]+ Done compare_conf_files 2> /dev/null
> root at lynx:/root(3)# R
>
> R version 2.12.1 (2010-12-16)
> Copyright (C) 2010 The R Foundation for Statistical Computing
> ISBN 3-900051-07-0
> Platform: x86_64-pc-linux-gnu (64-bit)
>
> R is free software and comes with ABSOLUTELY NO WARRANTY.
> You are welcome to redistribute it under certain conditions.
> Type 'license()' or 'licence()' for distribution details.
>
> R is a collaborative project with many contributors.
> Type 'contributors()' for more information and
> 'citation()' on how to cite R or R packages in publications.
>
> Type 'demo()' for some demos, 'help()' for on-line help, or
> 'help.start()' for an HTML browser interface to help.
> Type 'q()' to quit R.
>
>> .libPaths()
> [1] "/root/R/x86_64-pc-linux-gnu-library/2.12"
> [2] "/usr/lib64/R/library"
>>
>
>
> How can I reset libPaths permanently for root to "/usr/lib64/R/library"?
>
> I have:
> root at lynx:/root(4)# R --version
> R version 2.12.1 (2010-12-16)
> ..
>
> Regards.
>
>
> --
> Juergen Rose <rose at rz.uni-potsdam.de>
> Uni-Potsdam
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>
--
Brian D. Ripley, ripley at stats.ox.ac.uk
Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel: +44 1865 272861 (self)
1 South Parks Road, +44 1865 272866 (PA)
Oxford OX1 3TG, UK Fax: +44 1865 272595
More information about the R-help
mailing list