[R] problem plotting nls objects: couldn't find function "..."

Prof Brian D Ripley ripley at stats.ox.ac.uk
Tue Feb 12 18:34:58 CET 2002


On Tue, 12 Feb 2002, Cooke, Barry wrote:

> Dear R-help,
>
> I can't plot nls objects for some reason.  The following example, taken from
> help(plot.nls) illustrates the problem:
>
> > data(Orthodont)
> > fm1 <- lme(distance ~ age, Orthodont, random = ~ age | Subject)
> > plot(fm1, resid(., type = "p") ~ fitted(.) | Sex, abline = 0)
> Error in do.call(plotFun, as.list(args)) :
>         couldn't find function "xyplot"

> I checked the 2002 archives to see if this is a common problem resulting
> from a recent break, but found no hints of that.  I am guessing that plot()
> is correctly calling on plot.nls() which is calling the S function xyplot()
> instead of the  R function plot.xy(), but I am not sure if this is so.  The
> code for plot.nls(), appended below, suggests this is the intended
> behaviour.  I noticed here that plot.nls() also relies on bwplot(), which I
> (and my system) can't find either.  Why would this be happening and what
> should I change?  I should mention: packages nls and nlme were loaded at
> startup using the library() command.  Sorry if I am missing something
> obvious.

library(lattice)

(which is in that Windows distribution, but otherwise you would need to get
it from CRAN, plus grid).

Until recently this did not work in R, but at least your example now does.

xyplot is nothing like plot.xy.

[...]

-- 
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 272860 (secr)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list