Displaying 1 result from an estimated 1 matches for "xtemp2".
Did you mean:
temp2
2010 Mar 22
2
Problem with factors in lm() when using Rscript but not GUI
...t;- rep(c(1:12),3)
y <- 1:length(x)+rnorm(length(x))
print(x)
print(y)
#this bit works OK
xtemp <- lm(y ~ x )
print(xtemp)
print("got to here (without factor part)")
monthfac <- as.factor(x)
print(monthfac)
#this line below causes probs in R v2.10.1 when run from Rscript.....
xtemp2 <- lm(y ~ monthfac)
print(xtemp2)
stop("stopped on purpose",call.=F)
#end of file tnp2.r
###############################################
#error message is thus:
Error in `contrasts<-`(`*tmp*`, value = "contr.treatment") :
could not find function "is"
Call...