[R] Automatically updating GLM object

LE TERTRE Alain a.letertre at invs.sante.fr
Wed Oct 22 10:17:57 CEST 2003


Sure that doesn't work is not very informative.

The error message is "Error in update.default(mod.init, new.form, data = mydata, na.action = na.omit) : 
        need an object with call component"
That's because he's looking at a character object (the name) and not at the object itself.

But your solution is what i wanted.

Thanks both for the solution and your ability to read further an obscure doesn't work

O__ ---- Alain Le Tertre
 c/ /'_ --- Institut de Veille Sanitaire (InVS)
(*) \(*) -- 12 rue du val d'Osne
~~~~~~~~~~ - 94415 Saint Maurice cedex FRANCE
Voice: 33 1 41 79 67 50 Fax: 33 1 41 79 67 68
email: a.letertre at invs.sante.fr



> -----Message d'origine-----
> De : Prof Brian Ripley [mailto:ripley at stats.ox.ac.uk] 
> Envoyé : mercredi 22 octobre 2003 09:56
> À : LE TERTRE Alain
> Cc : r-help at stat.math.ethz.ch
> Objet : Re: [R] Automatically updating GLM object
> 
> 
> What does
> 
> 	Doesn't work
> 
> mean here?
> 
> Note that myobject[ii] is unlikely to be what you want, and 
> perhaps it 
> should be
> 
> get(paste("myobject", ii, sep=""))
> 
> but the error messages you surely got should have been informative.
> 
> On Wed, 22 Oct 2003, LE TERTRE Alain wrote:
> 
> > 
> > Dear all,
> > i generated several GLM objects, named myobject1 to myobject25. Now 
> > i'd like to update both of them. So i tried:
> > 
> > for(ii in 1:25) {
> >      assign(paste("myobject.updated", ii, sep=""), update( 
> > myobject[ii] ,.~ + VAR2))
> >     }
> > 
> > Doesn't work
> > I also tried to get all the names in a vector and 
> > update(names.myobject[ii],.~ + VAR2) Stiil doesn't work
> 
> -- 
> Brian D. Ripley,                  ripley at stats.ox.ac.uk
> Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
> University of Oxford,             Tel:  +44 1865 272861 (self)
> 1 South Parks Road,                     +44 1865 272866 (PA)
> Oxford OX1 3TG, UK                Fax:  +44 1865 272595
> 
>




More information about the R-help mailing list