Next: Using C, C++, and
Up: R, S, and Splus
Previous: Libraries in R
- If you don't have control over your Linux/UNIX system (i.e., cannot
act as root) or for some other reason want to install a library in
a local home directory, this is easy to do on a web-connected machine;
note that install.packages() automatically goes out and downloads
the package from CRAN.
install.packages('packageName',lib='~
/R/library')
# or use whatever path you'd like in place of ~
/R/library
library(packageName,lib.loc='~
/R/library')
- On the HSPH Linux cluster, you can't do the install.packages() command
above because the slave nodes do not have access the web and the head
node will not run R. To get around this,
- go to CRAN and download the .tar.gz file listed under downloads/package
source to your home directory on hpcc
- from the hpcc head node (i.e., after logging onto hpcc.sph.harvard.edu),
run (making sure to include the quotations and syntax as indicated):
bsub "R CMD INSTALL -l ~
/R/library packageName.tar.gz
>& logfile.txt"
(you probably want to use the short queue for this)
- look in 'logfile.txt' to make sure it has installed correctly
- call the library in your batch code:
library(packageName,lib.loc='~
/R/library')
Keywords: library, install, installation, R, local
Last modified 2/6/06.
Next: Using C, C++, and
Up: R, S, and Splus
Previous: Libraries in R
Chris Paciorek
2006-04-02