Run R script from command line

前端 未结 7 1834
甜味超标
甜味超标 2020-11-22 09:20

I have a file, called a.r, it has a chmod of 755,

sayHello <- function(){
   print(\'hello\')
}

sayHello()

Ho

7条回答
  •  情书的邮戳
    2020-11-22 09:28

    One more way of running an R script from the command line would be:

    R < scriptName.R --no-save  
    

    or with --save.

    See also What's the best way to use R scripts on the command line (terminal)?.

提交回复
热议问题