On Sat, 19 Jul 1997, Ted Harding wrote:>
> An early Venables example runs
> > {plot(x,y)
> + abline(0,1,lty=3)
> + abline(lsfit(x,y))
> + lines(spline(x,y))}
>
> which performs the first two OK but then gives error-message
>
> Error: no applicable method for "coefficients"
The coef function has no default method, only methods for lm and glm
objects. You can add
coefficients.default<- function (model)
{
if (is.null(model$coef))
stop("Object has no coefficients")
model$coef
}
which makes lsfit() work with coef().
Thomas Lumley
------------------------------------------------------+------
Biostatistics : "Never attribute to malice what :
Uni of Washington : can be adequately explained by :
Box 357232 : incompetence" - Hanlon's Razor :
Seattle WA 98195-7232 : :
------------------------------------------------------------
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-r-help
mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To: r-help-request at
stat.math.ethz.ch
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=