I have a file, called a.r, it has a chmod of 755,
a.r
chmod
sayHello <- function(){ print(\'hello\') } sayHello()
Ho
One more way of running an R script from the command line would be:
R < scriptName.R --no-save
or with --save.
--save
See also What's the best way to use R scripts on the command line (terminal)?.