[Rd] bug in y limits in bwplot (PR#2865)

deepayan at stat.wisc.edu deepayan at stat.wisc.edu
Wed May 14 00:50:17 MEST 2003


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 at 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)



More information about the R-devel mailing list