Skip to content
Prev 132484 / 398506 Next

Different labels by panel in barchart

On 12/19/07, Richard.Cotton at hsl.gov.uk <Richard.Cotton at hsl.gov.uk> wrote:
You need to do the dropping of the levels separately for each panel:

barchart(y~x|g, data = testdf, scales=list(x=list(relation="free")),
         prepanel = function(x, y, ...) {
             x <- x[, drop = TRUE]
             prepanel.default.bwplot(x, y, ...)
         },
         panel = function(x, y, ...) {
             x <- x[, drop = TRUE]
             panel.barchart(x, y, ...)
         })

-Deepayan