Run R script from Powershell

后端 未结 2 712
再見小時候
再見小時候 2021-02-05 21:00

In batch script, I can run an R script with the following syntax:

Rterm.exe --quiet --slave --vanilla < \"C:\\some_script.R\"

However, Power

相关标签:
2条回答
  • 2021-02-05 21:41

    You should probably look Rscript instead of redirection -- this would become

    Rscript.exe C:\someScript.R
    

    where you can add the usual options.

    0 讨论(0)
  • 2021-02-05 21:47

    Easiest way is probably to wrap it in a call to cmd.exe:

    cmd.exe /C "Rterm.exe --quiet --slave --vanilla < `"C:\some_script.R`""
    
    0 讨论(0)
提交回复
热议问题