R: Difference between revisions

63 bytes added ,  5 years ago
no edit summary
No edit summary
No edit summary
Line 18: Line 18:
|module load r/3.3.3
|module load r/3.3.3
}}  
}}  
For more on this see [[Utiliser des modules/en|Using modules.]]


<!--T:10-->
<!--T:10-->
With R and the appropriate modules now loaded in your environment, you can start the R interpreter and type R code inside that environment:
Now you can start the R interpreter and type R code inside that environment:
{{Command
{{Command
|lang="R"
|lang="R"
Line 53: Line 54:
> q()
> q()
}}
}}
To execute R scripts, use the <tt>Rscript</tt> front-end with the file containing the R commands as an argument:
 
To execute an R script non-interactively, use <code>Rscript</code> with the file containing the R commands as an argument:


<!--T:16-->
<!--T:16-->
Line 59: Line 61:


<!--T:17-->
<!--T:17-->
This front-end will automatically pass scripting-appropriate options <tt>--slave</tt> and <tt>--no-restore</tt> to the R interpreter. These also imply the <tt>--no-save</tt> option, preventing the creation of useless workspace files on exit. Note that any calculations last more than two or three minutes should not be run on the login node of the cluster but inside of a [[Running jobs|job]].
<code>Rscript</code> will automatically pass scripting-appropriate options <tt>--slave</tt> and <tt>--no-restore</tt> to the R interpreter. These also imply the <tt>--no-save</tt> option, preventing the creation of useless workspace files on exit.  
 
Note that '''any calculations lasting more than two or three minutes should not be run on the login node'''.
They should be run via the job scheduler.  See [[Running jobs]] for more information.


== Installing R packages ==  
== Installing R packages ==  
Bureaucrats, cc_docs_admin, cc_staff
2,879

edits