Skip to content
Dirk Eddelbuettel edited this page Sep 23, 2015 · 9 revisions

Miscellaneous

Porting from Rscript

Per @jangorecki in issue ticket #32 (and slightly edited)

argv <- if (!exists("argv")) commandArgs(TRUE) else as.character(argv)
cat(str(argv))
q("no")

(Not sure this makes a lot of sense, actually, as exists("argv") is always TRUE for r. Consider:

edd@don:~$ r -e 'str(commandArgs(TRUE)); str(argv); print(exists("argv"))'
 chr(0) 
 NULL
[1] TRUE
edd@don:~$ 

Oh well.)

Clone this wiki locally