Rscript:找不到命令 Automator

Rscript: command not found Automator

我想在 mac 中自动化脚本。我关注 this post,但 Automator 抛出错误 -: Rscript: command not found。 实际上 运行 Automator 中的简单命令 Rscript 不起作用。但它在终端内工作...... 有什么建议吗?

我尝试安装最新版本的 R (3.6.2),但矛盾仍然存在。

版本信息:

R version 3.6.2 (2019-12-12) -- "Dark and Stormy Night"
Platform: x86_64-apple-darwin15.6.0 (64-bit)

正如@alistaire 所建议的,使用 /usr/local/bin/R --slave -e 而不是 Rscript 效果很好。

再补充一个用例,当R程序在不同位置时,R工作空间应该被忽略,输入是一个待处理的R文件。

/usr/bin/R --vanilla --slave -f "src/parallel.R"