[R] Error Message from Variogram.lme Example

Dieter Menne dieter.menne at menne-biomed.de
Tue Mar 14 08:44:45 CET 2006


Rick Bilonick <rab45+ <at> pitt.edu> writes:

> 
> When I try to run the example from Variogram with an lme object, I get
> an error (although summary works):
> 
> > library(nlme)
> >  fm1 <- lme(weight ~ Time * Diet, BodyWeight, ~ Time | Rat)
> >      Variogram(fm1, form = ~ Time | Rat, nint = 10, robust = TRUE)
> Error in "$<-.data.frame"(`*tmp*`, "n.pairs", value = c(160, 0, 160,
> 16,  :
>         replacement has 10 rows, data has 9
> 

The example is does not run, but if you leave out nint=10 (giving default 
nint=20), or use any number nint >=12, it works.

The example has a "don't run" in the docs, but it could easily be cleaned up. 
If it should serve as documentation of the error message, it's a bit confusing.

Dieter




More information about the R-help mailing list