[R] Error in nlme ranef plot()

Douglas Bates bates at stat.wisc.edu
Mon Apr 8 22:15:49 CEST 2002


"Yang, Richard" <dyang at nrcan.gc.ca> writes:

> I have a 10 x 423 data frame which consisting of response, time, subject,
> site, plot and covariates (continueous and categorical) measured at the plot
> level. When the data frame was converted into a groupedData object, a
> warning appeared
> 
> > A <- groupedData(ht ~ time | Subject, data = tt, outer = ~ site * plot,
> +      labels=list(y = "Height", x = "Time", units = list( y = "(m)", x =
> "(Yr)")) )
> Warning message: 
> argument lengths differ in: split(x, f).

I think you are missing a closing parenthesis in that call to
groupedData.

It should be 

A <- groupedData(ht ~ time | Subject, data = tt, outer = ~ site * plot,
   labels=list(y = "Height", x = "Time"), 
   units = list( y = "(m)", x ="(Yr)"))

That won't affect the fitting routines but it can affect the plots.

Please remember that you must use

library(lattice)

to do any of the plotting in the nlme package.  Once R-1.5.0 is out
the nlme package will require the lattice package.
               
> The warning did not affect the estimation of a nlme model with parameters
> B1, B2, and B3. However, when plotting  the estimated ranef versus
> covariates, an error resulted
> 
> > A1Mod.nlmeRE <- ranef(A1Mod.nlme, aug=T)
> 
> > plot(A1Mod.nlmeRE, form = B1 ~ Ps + Dr + El + As + Sl) results in 
> Error in max(length(x0), length(x1), length(y0), length(y1)) : 
>         Argument "x0" is missing, with no default 
> 
> The same data frame and commands works fine with Splus 6 on W2K. Is this a
> bug in nlme 3.3.x? I use R 1.4.1.
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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