本文翻译自:Run R script from command line
I have a file, called ar
, it has a chmod
of 755, 我有一个名为ar
的文件,它的chmod
为755,
sayHello <- function(){
print('hello')
}
sayHello()
How can I run this via command-line? 如何通过命令行运行它?
#1楼
参考:https://stackoom.com/question/1EoJu/从命令行运行R脚本
#2楼
You need the ?Rscript
command to run an R script from the terminal. 您需要?Rscript
命令从终端运行R脚本。
Check out http://stat.ethz.ch/R-ma