【发布时间】:2014-07-08 22:07:01
【问题描述】:
我有一个 R 文件 (myfile.R)。我想使用 shell 脚本运行它。我怎样才能做到这一点? 我试过这个:
#! /bin/bash
Rscript myfile.R
但它给了我这个错误:Rscript: command not found
我也试过这个:
#! /bin/bash
R --not-save-- < myfile.R
它也给出了这个错误:R : command not found
最好的方法是什么?
【问题讨论】:
-
格式化在那里产生了影响。 R 可能不在您的 PATH 环境变量中。你可以通过输入
R从命令行运行R吗?bash是你的默认外壳吗?