I want to use RStudio to edit an R-script having command line parameters, e.g.,
my_rscript --dataset mydataset
and then to read the optiion
You can call your programs using Rscript programname.r arg1 arg2 arg3. The arguments are passed to commandArgs, so the following would be true:
Rscript programname.r arg1 arg2 arg3
commandArgs
Rscript programname.r F N 32 > args <- commandArgs(trailingOnly=TRUE) > args[1] [1] F > args[2] [1] N > args[3] [1] 32