Do you know to pass named command line arguments into an R script? I have used littler and argv to pass a vector of arguments, but this requires you to maintain the order of the arguments. I'm wondering if there is a way to do this when you do not know the order of the arguments being passed in. Thanks, Andrew Bierbryer [[alternative HTML version deleted]]
Hi, On Thu, Jul 1, 2010 at 2:49 PM, Bierbryer, Andrew <abierbryer at klsdiversified.com> wrote:> Do you know to pass named command line arguments into an R script? > > I have used littler and argv to pass a vector of arguments, but this > requires you to maintain the order of the arguments. > > I'm wondering if there is a way to do this when you do not know the > order of the arguments being passed in.Perhaps you'd find the optparse package helpful: https://r-forge.r-project.org/projects/optparse/ -- Steve Lianoglou Graduate Student: Computational Systems Biology | Memorial Sloan-Kettering Cancer Center | Weill Medical College of Cornell University Contact Info: http://cbio.mskcc.org/~lianos/contact
On Thu, Jul 01, 2010 at 02:49:20PM -0400, Bierbryer, Andrew wrote:> Do you know to pass named command line arguments into an R script? > > I have used littler and argv to pass a vector of arguments, but this > requires you to maintain the order of the arguments.Install the getopt package from CRAN eg via 'apt-get install r-cran-getopt' D.> > I'm wondering if there is a way to do this when you do not know the > order of the arguments being passed in. > > > > Thanks, > > > > Andrew Bierbryer > > > > > > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code.-- Three out of two people have difficulties with fractions.