User Tools

Site Tools


r

**This is an old revision of the document!**

R

The “R” statistical/programming package is installed on the clusters. Most add-on packages are in the 4.0.2 version. Also included are slightly newer 4.1.0 and slightly modified Microsoft R 4.0.2, plus older saved versions.

module load gcc/7.3.1 mkl/19.0.4 R/4.0.2

“gcc” module may be omitted unless you are adding R packages (see below). Substitute R/4.1.0 or MR/4.0.2 as desired for those versions.

If you need a new R package, you can ask support to add it to the central installation, or you can add your own packages as shown below for the package “broman”. R is not as prone to conflicts as Python, so most packages can be added to the central installation without issues. Another way to create a custom installation is using conda, which would be better if you see conflicts with standard R, at the cost of installing thousands of files.

Before starting, create files ~/.Rprofile and ~/.Renviron as shown, plus other variables you may need. See rstats.wtf. Some redundant text output has been omitted.

pinnacle-l4:feynman:$ cat .Rprofile
options(repos = c(CRAN = "https://mirrors.nics.utk.edu/cran"))
pinnacle-l4:feynman:$ cat .Renviron
R_LIBS_USER=~/R/%p/%v
pinnacle-l4:feynman:$ module load gcc/7.3.1 mkl/19.0.4 R/4.0.2
pinnacle-l4:feynman:$ R

R version 4.0.2 (2020-06-22) -- "Taking Off Again"
[Previously saved workspace restored]

> install.packages("broman")
Installing package into ‘/scrfs/storage/feynman/home/R/x86_64-pc-linux-gnu/4.0’
(as ‘lib’ is unspecified)
trying URL 'https://mirrors.nics.utk.edu/cran/src/contrib/broman_0.76.tar.gz'
Content type 'application/x-gzip' length 79834 bytes (77 KB)
==================================================
downloaded 77 KB

* installing *source* package ‘broman’ ...
** package ‘broman’ successfully unpacked and MD5 sums checked
** using staged installation
** libs
gcc -I"/share/apps/R/R-4.0.2/lib64/R/include" -DNDEBUG   -I/usr/local/include   -fpic  -g -O2  -c R_init.c -o R_init.o
gcc -I"/share/apps/R/R-4.0.2/lib64/R/include" -DNDEBUG   -I/usr/local/include   -fpic  -g -O2  -c compare_rows.c -o compare_rows.o
gcc -I"/share/apps/R/R-4.0.2/lib64/R/include" -DNDEBUG   -I/usr/local/include   -fpic  -g -O2  -c count_close.c -o count_close.o
gcc -I"/share/apps/R/R-4.0.2/lib64/R/include" -DNDEBUG   -I/usr/local/include   -fpic  -g -O2  -c normalize.c -o normalize.o
gcc -I"/share/apps/R/R-4.0.2/lib64/R/include" -DNDEBUG   -I/usr/local/include   -fpic  -g -O2  -c runningmean.c -o runningmean.o
gcc -shared -L/share/apps/R/R-4.0.2/lib64/R/lib -L/usr/local/lib64 -o broman.so R_init.o compare_rows.o count_close.o normalize.o runningmean.o -L/share/apps/R/R-4.0.2/lib64/R/lib -lR
installing to /scrfs/storage/feynman/home/R/x86_64-pc-linux-gnu/4.0/00LOCK-broman/00new/broman/libs
** R
** data
*** moving datasets to lazyload DB
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded from temporary location
** checking absolute paths in shared objects and dynamic libraries
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (broman)

The downloaded source packages are in
	‘/tmp/RtmpRuxu78/downloaded_packages’
> quit()
Save workspace image? [y/n/c]: n
pinnacle-l4:feynman:$
r.1639506410.txt.gz · Last modified: 2021/12/14 18:26 by root