Skip to content

R and default library

3 messages · Ronaldo Reis Jr., Brian Ripley, Deepayan Sarkar

#
Hi,
I have R installed in a system, but I need to install some packages as normal 
user on linux. Is possible to R use others library to get packages or one by 
one?

Ex.

I have some main package installed in /usr/lib/R/library

And now I need to install my own packages in ~/R/library

And I need to use the packages in main library and in my own library.

Its possible?
Thanks
Ronaldo
#
There's an example in ?Startup with exactly this.
(If you don't see the point of R_LIBS, search for it in ?library.)
On Wed, 20 Nov 2002, Ronaldo Reis Jr. wrote:

            

  
    
#
(Assuming that you are on Unix/Linux,) You can install libraries from source 
to anywhere you want by using the -l flag to R INSTALL, e.g.

R INSTALL -l ~/R/library <package>.tar.gz

You can load them inside R by 

library(package, lib.loc = "~/R/library")

(If you want to do this often, you might want to have a .Renviron file under ~ 
with the line

R_LIBS=~/R/library

in which case library() will search for a package there before looking in the 
system wide location.)
On Wednesday 20 November 2002 11:39 am, Ronaldo Reis Jr. wrote:
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._