Difference between revisions of "Applications/R"

From HPC
Jump to: navigation , search
m
Line 6: Line 6:
 
* Licence: GNU
 
* Licence: GNU
  
==Usage==
+
==Information==
 
 
 
R is a language and environment for statistical computing and graphics. It is a GNU project which is similar to the S language and environment which was developed at Bell Laboratories (formerly AT&T, now Lucent Technologies) by John Chambers and colleagues. R can be considered as a different implementation of S. There are some important differences, but much code written for S runs unaltered under R.
 
R is a language and environment for statistical computing and graphics. It is a GNU project which is similar to the S language and environment which was developed at Bell Laboratories (formerly AT&T, now Lucent Technologies) by John Chambers and colleagues. R can be considered as a different implementation of S. There are some important differences, but much code written for S runs unaltered under R.
  
Line 14: Line 13:
 
One of R’s strengths is the ease with which well-designed publication-quality plots can be produced, including mathematical symbols and formulae where needed. Great care has been taken over the defaults for the minor design choices in graphics, but the user retains full control.
 
One of R’s strengths is the ease with which well-designed publication-quality plots can be produced, including mathematical symbols and formulae where needed. Great care has been taken over the defaults for the minor design choices in graphics, but the user retains full control.
  
 +
==Usage Examples==
 +
===Interactive===
 
'''Note''': R supports interactive mode (as below) and execution mode running as an interpreted script.
 
'''Note''': R supports interactive mode (as below) and execution mode running as an interpreted script.
  
 
<pre style="background-color: black; color: white; border: 2px solid black; font-family: monospace, sans-serif;">
 
<pre style="background-color: black; color: white; border: 2px solid black; font-family: monospace, sans-serif;">
  
[username@gpu01 ~]$ module R/3.3.0
+
[username@gpu01 ~]$ module add R/3.3.0
 
[username@gpu01 ~]$ R
 
[username@gpu01 ~]$ R
  
Line 42: Line 43:
  
 
</pre>
 
</pre>
 +
 +
=== Batch Submission ===
 +
<pre style="background-color: #C8C8C8; color: black; font-family: monospace, sans-serif;">
 +
#!/bin/bash
 +
#SBATCH -J My_R_job              # Job name, you can change it to whatever you want
 +
#SBATCH -N 1                # Number of nodes
 +
#SBATCH -o %N.%j.out        # Standard output will be written here
 +
#SBATCH -e %N.%j.err        # Standard error will be written here
 +
#SBATCH -p compute          # Slurm partition, where you want the job to be queued
 +
 +
module purge
 +
module add R/3.3.0
 +
 +
R CMD BATCH Random.R
 +
</pre>
 +
 +
<pre style="background-color: #000000; color: white; border: 2px solid black; font-family: monospace, sans-serif;">
 +
[username@login01 ~]$ sbatch Rtest.job
 +
Submitted batch job 289522
 +
</pre>
 +
  
 
==Further Information==
 
==Further Information==

Revision as of 13:09, 8 June 2017

Application Details

  • Description: R is an open source programming language and software environment for statistical computing and graphics
  • Version: 3.3.0
  • Modules: R/3.3.0
  • Licence: GNU

Information

R is a language and environment for statistical computing and graphics. It is a GNU project which is similar to the S language and environment which was developed at Bell Laboratories (formerly AT&T, now Lucent Technologies) by John Chambers and colleagues. R can be considered as a different implementation of S. There are some important differences, but much code written for S runs unaltered under R.

R provides a wide variety of statistical (linear and non-linear modelling, classical statistical tests, time-series analysis, classification, clustering, …) and graphical techniques, and is highly extensible. The S language is often the vehicle of choice for research in statistical methodology, and R provides an Open Source route to participation in that activity.

One of R’s strengths is the ease with which well-designed publication-quality plots can be produced, including mathematical symbols and formulae where needed. Great care has been taken over the defaults for the minor design choices in graphics, but the user retains full control.

Usage Examples

Interactive

Note: R supports interactive mode (as below) and execution mode running as an interpreted script.


[username@gpu01 ~]$ module add R/3.3.0
[username@gpu01 ~]$ R

R version 3.3.0 (2016-05-03) -- "Supposedly Educational"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

  Natural language support but running in an English locale

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

>

Batch Submission

#!/bin/bash
#SBATCH -J My_R_job              # Job name, you can change it to whatever you want
#SBATCH -N 1                # Number of nodes 
#SBATCH -o %N.%j.out        # Standard output will be written here
#SBATCH -e %N.%j.err        # Standard error will be written here
#SBATCH -p compute          # Slurm partition, where you want the job to be queued 
 
module purge
module add R/3.3.0
 
R CMD BATCH Random.R
[username@login01 ~]$ sbatch Rtest.job
Submitted batch job 289522


Further Information