从 Powershell 运行 R 脚本 [英] Run R script from Powershell
本文介绍了从 Powershell 运行 R 脚本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在批处理脚本中,我可以使用以下语法运行 R 脚本:
In batch script, I can run an R script with the following syntax:
Rterm.exe --quiet --slave --vanilla < "C:\some_script.R"
然而,Powershell 似乎保留了<"用于未来的扩展.我想知道是否有一种直接的方法可以在另一个 Powershell 脚本中运行 R 脚本.
However, Powershell seems to have reserved "<" for future expansion. I am wondering if there is a direct way to run R script within another Powershell script.
推荐答案
你可能应该看看 Rscript
而不是重定向——这会变成
You should probably look Rscript
instead of redirection -- this would become
Rscript.exe C:\someScript.R
您可以在其中添加常用选项.
where you can add the usual options.
这篇关于从 Powershell 运行 R 脚本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文