2011-08-17 31 views

回答

2

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

R --slave --vanilla --file=myScript.R --args foo=2 bar=3 "s=string with spaces" > output.txt 

...然后在myScript.R我用args <- commandArgs(TRUE)来获得额外的参数foo etc ...