Monday 15 April 2013

How to install an R library

This is a note to self: I can never remember how to install an R package on the Sanger computer system. Here goes:

1. Change directory to ~alc/R/library.
2. Start R.
2. Download the R library eg. for the 'bblme2' package, by typing in R:
   > system("wget cran.r-project.org/src/contrib/bbmle_1.0.5.2.tar.gz")
3. Install the R package by typing in R:
   > install.packages("bbmle_1.0.5.2.tar.gz", repos=NULL, lib="~alc/R/library")
4. Now you should be able to use the package in R:
   > library(bbmle, lib="~alc/R/library")

[Note to self: Magdalena has installed R packages compiled for R3-0.0 here:
/nfs/users/nfs_m/mz3/bin/R-packages ]

No comments: