On 09/16/13 19:01, Charles Thuo wrote:
  How can a person in a controlled environment install additional R
packages...

Use a "local library" in your user space. Create a directory --- I called mine "Rlib", and it is located in my home directory. I.e. my local library is /home/rolf/Rlib.

Then when using install.packages() from within R I invoke the function with
the syntax

install.packages("<whatever>",lib="/home/rolf/Rlib",<other possible arguments>)

Installing from source, from the command line I do:

    R CMD INSTALL <whatever>.tar.gz -l /home/rolf/Rlib

To load a package from one's local library one can do things like:

    library(<whatever>,lib.loc="/home/rolf/Rlib")

Note that the argument specifying the local library is named "lib" in install.packages() but is named "lib.loc" in library(). I can never remember which is which. Psigh!

Or you can add your local library to your .libPaths(), as in:

    .libPaths("/home/rolf/Rlib")

You can put a line like this in your .Rprofile file so that it gets done automatically
when you start R.  Or you can set an environment variable R_LIBS:

    setenv R_LIBS /home/rolf/Rlib

(if using csh) or

    R_LIBS = /home/rolf/Rlib
    export R_LIBS

(if using bash).


HTH

    cheers,

    Rolf Turner

______________________________________________
R-help@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.

Reply via email to