Run R script from command line

前端 未结 7 1616
甜味超标
甜味超标 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:41

    Just for documentation, sometimes you need to run the script as sudo:

    sudo Rscript path/to/your/file.R
    

提交回复
热议问题