The following commands work fine in RStudio, but not RScript:
require(glmnet)
calibdata = read.csv(\"calibrationfile.csv\")
xs = model.matrix(as.formula(\"t
I ran into same issue, and found two possible workaround (just for a complement of @Dirk Eddelbuettel's answer):
Well, I read somewhere that --default-packages=methods,utils needs to be passed to Rscript to work around this: https://github.com/stan-dev/rstan/issues/190
OR,
Also, it seems, Rscript being missing the load of the methods package. This can also be fixed by calling library('methods') at the beginning of your script: https://github.com/dhimmel/elevcan/issues/1.
Hope this helps.