[R] xYplot - plotting all factors

John Poulsen
Wed, 24 Sep 2008 19:51:11 -0000

Hello,

Sorry, I have used xYplot before and feel like this should be a very
easy problem to solve.  But I keep hitting a snag.

I want the below code to plot three panels with different point
estimates and their standard errors for each of five days.  I keep
getting a warning message (see below) and only one panel of the graph is
plotted:

Warning messages:
1: In min(x) : no non-missing arguments to min; returning Inf
2: In max(x) : no non-missing arguments to max; returning -Inf
3: In min(x) : no non-missing arguments to min; returning Inf
4: In max(x) : no non-missing arguments to max; returning -Inf

Thanks for any solutions!
John

--------------Example data and code


library(lattice)
library(Hmisc)


Resp=factor(rep(c("FL", "ALM", "ATT"), each=5))
Est=c(5.98, 7.84, 11.27, 15.54, 4.94, 5.00, 6.33, 7.04, 7.37, 4.89,
0.19, 0.45, 0.52, 1.01, 0.52)
LSE=c(4.365, 6.219, 9.657, 13.928, 3.323, 4.766, 6.106, 6.832, 7.166,
4.671, -0.419, -0.090, 0.028, 0.544, 0.051)
USE=c(7.60, 9.45, 12.89, 17.16, 6.56, 5.23, 6.54, 7.25, 7.57, 5.10,
0.80, 0.98, 1.01, 1.47, 0.99)

dat=data.frame(Resp, Est, LSE, USE)


xYplot(Cbind(Est, LSE, USE)~days|factor(Resp), type="p",
method="bars",
data=dat,
         col.fill="light grey", subscripts = T, col="black",
lwd=2,
        scales=list(y=list(relation="free"),
x=list(alternating=c(1,1,1))),
         ylab="Response", xlab="Days",
        strip=strip.custom(style=1, bg="lightgrey",
        factor.levels=c("FL", "ALM", "ATT")))