[R] Detecting startup flags from within R.
Barry Rowlingson
b.rowlingson at lancaster.ac.uk
Fri Feb 20 00:18:05 CET 2009
2009/2/19 Rolf Turner <r.turner at auckland.ac.nz>:
>
>
> Is there a way to detect from within R whether, e.g., R has been
> started with the --no-restore-data flag set? So as to be able
> to invoke code along the following lines:
>
> if( --no-restore-data flag set) {
> do something
> } else {
> do something else
> }
>
> Thanks for any assistance.
?commandArgs
> "--no-restore-data" %in% commandArgs()
[1] TRUE
or false if I hadn't started it with that arg...
Barry
More information about the R-help
mailing list