March 2018
Beginner to intermediate
570 pages
13h 42m
English
There are a few ways to run saved R scripts, like nothing.R. First - and this is RStudio-specific - is to click the button labeled Source (component h). This is roughly equivalent to highlighting the entire document and clicking Run.
Of course, we would like to run R scripts without being dependent on RStudio. One way to do this is to use the source function in the interactive R console: either RStudio's console, the console that ships with R from CRAN, or your operating system's command prompt running R. The source function takes a filename as it's first and only required argument. The filename specified will be executed, and when it's done, it will return you to the prompt with all the objects from the R script now in ...