====== Using R ======
R is a free software environment for statistical computing and graphics. The
main website for R is located at the [[http://www.r-project.org/|R Project]].
R is a free implementation of the S language.
==== 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 the appropriate job scheduler command such as ''qlogin'' for GridEngine or ''salloc'' for Slurm to connect 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 [[#cluster-details|cluster details]] for R script in batch and R script array job in batch examples for more
information on running R in batch.
Most simply from a compute node, you can execute
$ Rscript /path/to/script.r
=====Details by cluster=====
* [[software:r:caviness| Caviness]]
* [[software:r:farber| Farber]]
=====Additional Resources =====
* [[http://www.statmethods.net/interface/index.html|Quick-R]] on-line tutorial
* [[http://www.ats.ucla.edu/stat/r/|UCLA idre]] on-line tutorial
* [[http://swirlstats.com/|SWIRL]] interactive tutorial (may not be available by default)
* [[http://www.manning.com/kabacoff/|R in action]] book
* [[http://shop.oreilly.com/product/0636920028352.do|O'Reilly Learning R]] Book
* [[http://stackoverflow.com/questions/tagged/r|Stack Overflow]] Questions and Answers
* [[https://science.nature.nps.gov/im/datamgmt/statistics/R/documents/R_for_SAS_SPSS_users.pdf|R for SAS and SPSS users PDF]] An excellent guide for converting SAS(r) and SPSS(r) to R.