[R] Automatically updating GLM object

Prof Brian Ripley ripley at stats.ox.ac.uk
Wed Oct 22 09:56:27 CEST 2003


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