How to call R functions from command line and from within R shell

(Last Updated On: May 29, 2012)

How to call R functions from command line and from within R shell

R < --vanilla mean.R
R CMD BATCH mean.R

 

If you are trying to run the file from inside the R shell, that's wrong way.
You should type
> source("mean.R")
instead