Re: [R] args and test of passed paramters

2009-04-17 Thread Gabor Grothendieck
Check out the getopt package. On Fri, Apr 17, 2009 at 11:39 AM, Juergen Rose wrote: > Hi, > I would like to call a R script sometimes with: >  R --slave --vanilla --args Debug=1 N=25 < test.R > and sometimes with >  R --slave --vanilla Debug=1 < test.R > or similar. > > Inside the R script I get

[R] args and test of passed paramters

2009-04-17 Thread Juergen Rose
Hi, I would like to call a R script sometimes with: R --slave --vanilla --args Debug=1 N=25 < test.R and sometimes with R --slave --vanilla Debug=1 < test.R or similar. Inside the R script I get the arguments with: args=(commandArgs(TRUE)) if(length(args)==0){ print("===No arguments s