This is an old revision of the document!
Using R
R is a free software environment for statistical computing and graphics. The main website for R is located at the R Project. R is a free implementation of the S language.
For details on
Learning R
Some resources to help learn R are:
- Quick-R on-line \
tutorial
- UCLA idre on-line tutorial
- SWIRL interactive tutorial (may not be available by default)
- R in action book
book
- Stack Overflow Questions \
and Answers
Transitioning to R
An excellent guide for converting SASĀ® and SPSSĀ® to R is located at in the R for SAS and SPSS users PDF located on the National Parks Service website.
Running R
Loading R
Checking for available R installations can be done with VALET as such:
$ vpkg_versions r Available versions in package (* = default version): [/opt/shared/valet/2.0/etc/r.vpkg_json] r The R Project for Statistical Computing * 3.1.1 Version 3.1.1 3 alias to r/3.1 3.1 alias to r/3.1.1 $ vpkg_require r/3
Interactive R
For interactive R sessions, make sure you use workgroup
and qlogin
to a compute node, then select the version of R you want to use
$ vpkg_require r Adding package `r/3.1.1` to your environment
and then you can execute
$ R
Additionally, if you would like to make R quiet about starting and exiting, try
$ R -q --no-save
Scheduling R
See the R script in batch and R script array job in batch page for more information on running R in batch.
Most simply from a compute node, you can execute
$ Rscript /path/to/script.r