Re: [R] getopt does not work as expected!

2012-03-30 Thread Trevor Davis
> Why is commandArgs()[1] = "/usr/lib64/R/bin/exec/R" and not > "getopt_test.R" as described by the help (?getopt)? That used to work but R changed the behavior of the commandArgs() function a couple of years ago, I guess the orginal author of getopt didn't update his example then. This will do t

Re: [R] getopt does not work as expected!

2012-03-30 Thread Juergen Rose
Am Mittwoch, den 28.03.2012, 14:08 +0200 schrieb Juergen Rose: > I have the following script (also attached): > ... > Ausführung angehalten > > This behaviour I don't like at all. Why getopt does not distinguish > beetween options starting with alt least one hyphen and normal arguments > starting

[R] getopt does not work as expected!

2012-03-28 Thread Juergen Rose
I have the following script (also attached): #!/usr/bin/Rscript spec=matrix(c( 'verbose', 'v', 1, "integer", 'help' , 'h', 0, "logical" ),ncol=4, byrow=TRUE) spec.dim=dim(spec) spec.opt.long=spec[,1] spec.opt.short=spec[,2] spec.opt.l <- spec.dim[1] infile <- "test.dat" args=commandArgs(