bug in y limits in bwplot (PR#2865)
This turns out to be a long-standing bug (in all the lattice functions in fact, not only bwplot). Should be fixed in the next release. A workaround is to use xlim and ylim directly instead of limits in scale.
On Monday 28 April 2003 01:20, rmh@surfer.sbm.temple.edu wrote:
## bug in y limits in bwplot
tmp <- data.frame(y=1:10, a=factor(rep(1:2,5)))
## x limits in bwplot works as expected
bwplot(y ~ a, data=tmp, horizontal=F) # works
bwplot(y ~ a, data=tmp, horizontal=F, # works
xlim=c(-1,5))
bwplot(y ~ a, data=tmp, horizontal=F, # works
scales=list(x=list(limits=c(-1,5))))
## problem with y limits in bwplot
bwplot(a ~ y, data=tmp, horizontal=T) # works
bwplot(a ~ y, data=tmp, horizontal=T, # works
ylim=c(-1,5))
bwplot(a ~ y, data=tmp, horizontal=T, # error message
scales=list(y=list(limits=c(-1,5))))
## transcript with error message
bwplot(a ~ y, data=tmp, horizontal=T, # error message
+ scales=list(y=list(limits=c(-1,5)))) Error in print.trellis(structure(list(as.table = FALSE, aspect.fill = TRUE, : Invalid value for labels In addition: Warning message: is.na() applied to non-(list or vector) in: is.na(x)