Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

useOuterStrips

Put Strips on the Boundary of a Lattice Display


Description

Try to update a "trellis" object so that strips are only shown on the top and left boundaries when printed, instead of in every panel as is usual. This is only meaningful when there are exactly two conditioning variables.

Usage

useOuterStrips(x,
               strip = strip.default,
               strip.left = strip.custom(horizontal = FALSE),
               strip.lines = 1,
               strip.left.lines = strip.lines)

Arguments

x

An object of class "trellis".

strip, strip.left

A function, character string or logical that would be appropriate strip and strip.left arguments respectively in a high level lattice function call (see xyplot)

strip.lines, strip.left.lines

height of strips in number of lines; helpful for multi-line text or mathematical annotation in strips.

Details

useOuterStrips modifies a "trellis" object with length(dim(x)) == 2 so that when plotted, strips are only shown on the top and left boundaries of the panel layout, rather than on top of every panel, as is the usual behaviour.

If the original "trellis" object x includes non-default strip and strip.left arguments, they will be ignored. To provide customized strip behaviour, specify the custom strip functions directly as arguments to useOuterStrips.

Value

An object of class "trellis"; essentially the same as x, but with certain properties modified.

Author(s)

Deepayan Sarkar

See Also

Examples

library(lattice)

mtcars$HP <- equal.count(mtcars$hp)

useOuterStrips(xyplot(mpg ~ disp | HP + factor(cyl), mtcars))

useOuterStrips(xyplot(mpg ~ disp | factor(cyl) + HP, mtcars),
               strip.left = FALSE,
               strip = strip.custom(style = 4))

latticeExtra

Extra Graphical Utilities Based on Lattice

v0.6-29
GPL (>= 2)
Authors
Deepayan Sarkar <deepayan.sarkar@r-project.org>, Felix Andrews <felix@nfrac.org>
Initial release
2019-12-18

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.