in reply to Re: Passing parameters to R script
in thread Passing parameters to R script

Thank you very much! This is precisely what I was looking for =)

Now I need to tweak it a bit for my needs. Thank you soooooooooo much!


Smoothie, smoothie, hundre prosent naturlig!

Replies are listed 'Best First'.
Re^3: Passing parameters to R script
by mariotomo (Initiate) on Dec 11, 2009 at 08:53 UTC
    very late answer, maybe the library is newer than your question, but what about optparse or getopt?
    install.packages('optparse') ?optparse
    I tried to get it working (I come from Python and I'm used to the syntax) but in the end I settled for the easier (and working) 'getopt' solution:
    install.packages('getopt') . . . if(require("getopt", quietly=TRUE)) { opt <- getopt(matrix(c('path', 'p', 1, "character"), ncol=4, byrow=TRUE)) if(!is.null(opt$path)) path <- opt$path }