RE: [Rd] how to use update if method for formula is not in namesp ace?

From: Liaw, Andy <andy_liaw_at_merck.com>
Date: Wed 15 Sep 2004 - 05:53:42 EST


> From: Prof Brian Ripley
>
> On Tue, 14 Sep 2004, Liaw, Andy wrote:
>
> > Dear R-devel,
> >
> > I've noticed that if the method for formula is not exported
> in NAMESPACE,
> > then update() would fail. As an example:
> >
> > > library(e1071)
> > > data(iris)
> > > iris.svm <- svm(Species ~ ., data=iris)
> > > update(iris.svm)
> > Error in eval(expr, envir, enclos) : couldn't find function
> "svm.formula"
> >
> > The same thing happens with randomForest, because
> randomForest.formula() was
> > not exported. Is this the intended behavior of update()?
> What would be the
> > preferred work-around?
>
> It is. randomForest.formula should be written to report its
> call as to
> randomForest. Take a look at e.g. rlm.formula.

Got it! Works now. Many thanks!

Best,
Andy  

> --
> Brian D. Ripley, ripley@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
>
>
>



R-devel@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Wed Sep 15 05:58:26 2004

This archive was generated by hypermail 2.1.8 : Wed 03 Nov 2004 - 22:45:15 EST