Re: [R] dotplot, dropping unused levels of 'y'

From: Sundar Dorai-Raj <sundar.dorai-raj_at_pdf.com>
Date: Fri 15 Sep 2006 - 19:45:42 GMT

Benjamin Tyner said the following on 9/15/2006 2:36 PM:
> In dotplot, what's the best way to suppress the unused levels of 'y' on
> a per-panel basis? This is useful for the case that 'y' is a factor
> taking perhaps thousands of levels, but for a given panel, only a
> handfull of these levels ever present.
>
> Thanks,
> Ben
>
> ______________________________________________
> R-help@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

Hi, Ben,

Use scales(x = list(relation = "free")) in your call to dotplot:

library(lattice)
z <- data.frame(x = rep(LETTERS[1:20], each = 4),

                 y = 1:80, g = gl(4, 20))
dotplot(y ~ x | g, z,
         scales = list(x = list(relation = "free")))

HTH, --sundar



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Sat Sep 16 05:55:56 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Fri 15 Sep 2006 - 20:30:24 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.