This function create a combined strip when two factor are used after the conditional operator em lattice functions (y ~ x | A + B).

strip_combined(which.given, which.panel, factor.levels, var.name, ...)

Arguments

which.given, which.panel, factor.levels, var.name, ...

See strip.custom().

Source

This function entirely based on a message in the R-help mailing list: http://r.789695.n4.nabble.com/merging-plot-labels-in-a-lattice-plot-td2276609.html.

Value

A combined strip for trellis plot.

Examples

library(lattice) da <- expand.grid(A = gl(2, 10), B = gl(3, 1)) da$x <- runif(nrow(da)) da$y <- rnorm(nrow(da), mean = da$x, sd = 1) xyplot(y ~ x | A + B, data = da)
xyplot(y ~ x | A + B, data = da, strip = strip_combined, par.settings = list(layout.heights = list(strip = 0.5)))
#> [1] "A" "B" #> [1] "A" "B" #> [1] "A" "B" #> [1] "A" "B" #> [1] "A" "B" #> [1] "A" "B" #> [1] "A" "B" #> [1] "A" "B" #> [1] "A" "B" #> [1] "A" "B" #> [1] "A" "B" #> [1] "A" "B"