[R] using variables in obj$model
Vito Muggeo
vito.muggeo at giustizia.it
Mon Oct 27 11:55:18 CET 2003
dear all,
for some reason I am intersted in updating a glm taking variables from its
model argument, namely:
> dati<-data.frame(y=runif(10),x=1:10)
> obj<-glm(y~x,data=dati)
> obj$model[,c("A","a:b")]<-cbind(rnorm(10),runif(10))
> names(obj$model)
[1] "y" "x" "A" "a:b"
> update(obj,.~.+A,data=obj$model) #it works
Call: glm(formula = y ~ x + A, data = obj$model)
............[SNIP]
> update(obj,.~.+A+a:b,data=obj$model) #it does not work
Error in eval(expr, envir, enclos) : Object "a" not found
Please, how can I solve this problem?
many thanks in avance,
best,
vito
More information about the R-help
mailing list