User Tools

Site Tools


r-software

Table of Contents

R

R is a free software environment for statistical computing and graphics.

Information

Usage

See which versions are available:

$ module avail R

Load one version into your environment and run it:

$ module load R/4.2
$ R

Use installed.packages() to check the list of packages installed in the ILRI environment by default. Here is a good resource on installing R packages into user libraries if you need other packages.

Installation

Notes from the sysadmin during installation.

First, compile the main R application:

$ cd /tmp
$ wget https://cran.r-project.org/src/base/R-4/R-4.2.0.tar.gz
$ tar xf R-4.2.0.tar.gz 
$ cd R-4.2.0
$ ./configure --enable-R-shlib --prefix=/export/apps/R/4.2
$ chrt -b 0 make -j4
$ sudo mkdir /export/apps/R/4.2
$ sudo chown aorth:aorth /export/apps/R/4.2
$ make install

Then install some common libraries used by our users because some of them are quite complicated, and installing them globally saves tens of thousands of header files and libraries being installed into user libraries anyways:

$ /export/apps/R/4.2/bin/R
# > Sys.setenv(MAKEFLAGS = "-j2") # didn't try
> options(Ncpus = 4) # This does 4 parallel package installs
> install.packages('sf', repo='https://cloud.r-project.org')
> install.packages("hierfstat", repos="https://cran.r-project.org")
> install.packages("adegenet", repos="https://cran.r-project.org")
> install.packages("BiocManager", repos="https://cran.r-project.org")
> install.packages("poppr", repos="https://cran.r-project.org")
> install.packages("vcfR", repos="https://cran.r-project.org")
> install.packages("devtools", repos="https://cran.r-project.org")
> library(devtools)
> install_github("HenrikBengtsson/TopDom")
> install_github("lucidif/HiCeekR", repos=BiocManager::repositories())
> q()
$ sudo chown -R root:root /export/apps/R/4.2
r-software.txt · Last modified: 2022/05/27 06:32 by aorth