software:r:r

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
software:r:r [2018-04-26 13:08] sraskarsoftware:r:r [2021-02-24 16:41] (current) – [Details by clusters] anita
Line 1: Line 1:
 +====== 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:
 +
 +<code>
 +$ 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
 +</code>
 +
 +=== 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
 +
 +<code>
 +$ vpkg_require r
 +Adding package `r/3.1.1` to your environment
 +</code>
 +
 +and then you can execute
 +
 +<code>
 +$ R
 +</code>
 +
 +Additionally, if you would like to make R quiet about starting and exiting,
 +try
 +
 +<code>
 +$ R -q --no-save
 +</code>
 +
 +=== 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
 +
 +<code>
 +$ Rscript /path/to/script.r
 +</code>
 +
 +=====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.