Department of Mathematics
University of Manitoba*
R
is a scripted language and when run from an R
console, it is interactive
\(\implies\) what you did before is in memory of the session you are working in
This is frequent cause for errors when sharing your code with others: some things are defined in your script, others you did in the session but did not copy to the script
When you install R
, you install several programs
Rscript
that allows you to run an .. R
script from your OS’ command lineor, from within the directory
Contrary to the interactive version, if you want to see an output when running from the command line, you have to force it using commands like print
or writeLines
Figures will also not be displayed, so you may want to save them