OS <oozingslackitude <at> gmail.com> writes: > Hi, > I have some code I run interactively through the R interpreter and it works > fine. I then run it as a script with Rscript and I get an error. The error > is coming when Rscript builds a model matrix. > > Output from Rscript with the error: > running > '/usr/lib/R/bin/R --slave --no-restore --file=./matchingModel --args > mmtest' > ...
> Error in `contrasts<-`(`*tmp*`, value = "contr.treatment") : > could not find function "is" > Calls: glm ... model.matrix -> model.matrix.default -> contrasts<- > I ran into the same problems. Apparently, Rscript somehow doesn't automatically load the 'methods' package. The problem can be solved by adding library(methods) in your script. ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.