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: [EMAIL PROTECTED]



> -----Message d'origine-----
> De : Prof Brian Ripley [mailto:[EMAIL PROTECTED] 
> Envoy� : mercredi 22 octobre 2003 09:56
> � : LE TERTRE Alain
> Cc : [EMAIL PROTECTED]
> 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,                  [EMAIL PROTECTED]
> 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
> 
>

______________________________________________
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help

Reply via email to