Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/78.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Shell中R CMD批处理模式中的参数_R_Shell - Fatal编程技术网

Shell中R CMD批处理模式中的参数

Shell中R CMD批处理模式中的参数,r,shell,R,Shell,我想用R CMD BATCH--no save--no restore从Shell脚本调用R脚本。 如何将参数(例如$1)从Shell脚本传输到R脚本 正如我在其他地方写的,批处理命令有时有点奇怪,所以我直接使用--file命令: R --slave --vanilla --file=myScript.R --args foo=2 bar=3 "s=string with spaces" > output.txt …然后在myScript.R中使用args

我想用
R CMD BATCH--no save--no restore
从Shell脚本调用R脚本。
如何将参数(例如
$1
)从Shell脚本传输到R脚本

正如我在其他地方写的,批处理命令有时有点奇怪,所以我直接使用--file命令:

R --slave --vanilla --file=myScript.R --args foo=2 bar=3 "s=string with spaces" > output.txt
…然后在
myScript.R
中使用
args