Re: [R] Writing R Scripts and passing command line arguments

2009-09-09 Thread Gabor Grothendieck
Put this line in a file called test.R: cat("command args are:\n"); print(commandArgs()) and then call it like this from the shell or Windows cmd line assuming that Rscript is in your path: Rscript test.R abc def On Wed, Sep 9, 2009 at 2:37 PM, Abhishek Pratap wrote: > Hi All > Thanks for the p

Re: [R] Writing R Scripts and passing command line arguments

2009-09-09 Thread Abhishek Pratap
Hi All Thanks for the pointers. reading them I see that what I intend to can certainly be done without much pain. However with my test scripts I am not able to fully understand Rscript. The ?Rscript option doesnt print out a lot to help me get the minute details. Any good example/s or some info on

Re: [R] Writing R Scripts and passing command line arguments

2009-09-07 Thread cls59
Abhishek Pratap wrote: > > > 1. What's the best way to pass command line arguments to R scripts ? > > As Gabor mentioned, the commandArgs function and the getopt package provide some excellent starting points for this. Abhishek Pratap wrote: > > > 2. How to execute R scripts from comman

Re: [R] Writing R Scripts and passing command line arguments

2009-09-07 Thread Gabor Grothendieck
See ?commandArgs, the getopt package and ?Rscript On Mon, Sep 7, 2009 at 1:47 PM, Abhishek Pratap wrote: > Hi Guys > I am Abhishek, primarily a bioinformatician.  I have recently started using > a lot of R thanks to some excellent packages available. > > Lately I have felt the need to batch proces