From p.dalgaard at biostat.ku.dk  Mon May 12 19:14:25 2003
From: p.dalgaard at biostat.ku.dk (p.dalgaard@biostat.ku.dk)
Date: Mon May 12 18:14:37 2003
Subject: [Rd] plot.ranef.lme (PR#2986)
Message-ID: <200305121614.h4CGEP2b019381@pubhealth.ku.dk>


library(nlme)
data(Phenobarb)
na.include <- function(x)x
phe1 <- nlme(conc~phenoModel(Subject, time, dose, lCl, lV),
     data  = Phenobarb,
     fixed = lCl+lV~1,
     random= pdDiag(lCl+lV~1),
     start = c(-5,0),
     na.action = na.include,
     naPattern = ~!is.na(conc))

phe.ranef <- ranef(phe1,augFrame=TRUE)
plot(phe.ranef, form=lCl~Wt+ApgarInd)

[Error in max(length(x0), length(x1), length(y0), length(y1)) :
        Argument "x0" is missing, with no default]

The cause is plain to see: in plot.ranef.lme we have

            staple.ends <- list(x1 = c(rep(X - w, 2), rep(X +
                w, 2)), y1 = rep(c(Y[5], max(Y[1] - e.u, Y[2])),
                2), x2 = c(rep(X - w, 2), rep(X + w, 2)), y2 = rep(c(min(Y[5] +                e.l, Y[4]), Y[1]), 2))
                       . . . .
            do.call("lsegments", c(staple.ends, box.umbrella))

but lsegments expects arguments named x0,y0,x1,y1 not x1,y1,x2,y2

-- 
   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard@biostat.ku.dk)             FAX: (+45) 35327907


[Rd] plot.ranef.lme (PR#2986)
p.dalgaard@biostat.ku.dk