Saturday, 15 February 2014

Is it possible to specify command line parameters to R-script in RStudio? -



Is it possible to specify command line parameters to R-script in RStudio? -

i want utilize rstudio edit r-script having command line parameters, e.g.,

my_rscript --dataset mydataset

and read optiion value r variable, say, dataset, e.g., using optparse library.

however, not find acommand line can provided in rstudio, utilize "source on save" feature. instead, have hardcode programme parameters in programme itself:

dataset <- "mydataset"

which requires modifying script text each time need specify different data.

does know how provide command line information?

i know question old , link below old, answers question. no, it's not possible (or wasn't of jan 29, 2012) access command line arguments rstudio.

link https://support.rstudio.com/hc/communities/public/questions/200659066-accessing-command-line-options-in-rstudio?locale=en-us

r rstudio

No comments:

Post a Comment