Hello, everyone
In top of my R script file, I add
for (arg in commandArgs(TRUE)) {
eval(parse(text = arg))
}
SO I can use $ Rscript myfile.R arg1 arg2
to run the script with arg1 and arg2.
Here, if argument1 is "x=1", then there is no problem. In other parts of my script file, x "equals" to 1
However, if the argument2 is "y=yes", the eval
process will be halted. That makes sense. I wonder how could I make the string "yes" be assigned to y.
Any suggestion would be appreciated.
Thank you very much.