D_strip.default | R Documentation |
strip.default
is the function that draws the strips by default
in Trellis plots. Users can write their own strip functions, but most
commonly this involves calling strip.default
with a slightly
different arguments. strip.custom
provides a convenient way to
obtain new strip functions that differ from strip.default
only
in the default values of certain arguments.
strip.default(which.given,
which.panel,
var.name,
factor.levels,
shingle.intervals,
strip.names = c(FALSE, TRUE),
strip.levels = c(TRUE, FALSE),
sep = " : ",
style = 1,
horizontal = TRUE,
bg = trellis.par.get("strip.background")$col[which.given],
fg = trellis.par.get("strip.shingle")$col[which.given],
par.strip.text = trellis.par.get("add.text"))
strip.custom(...)
which.given |
integer index specifying which of the conditioning variables this strip corresponds to. |
which.panel |
vector of integers as long as the number of
conditioning variables. The contents are indices specifying the
current levels of each of the conditioning variables (thus, this
would be unique for each distinct packet). This is identical to the
return value of |
var.name |
vector of character strings or expressions as long as
the number of conditioning variables. The contents are interpreted
as names for the conditioning variables. Whether they are shown on
the strip depends on the values of |
factor.levels |
vector of character strings or expressions
giving the levels of the conditioning variable currently being
drawn. For more than one conditioning variable, this will vary with
|
shingle.intervals |
if the current strip corresponds to a shingle,
this should be a 2-column matrix giving the levels of the shingle.
(of the form that would be produced by printing
|
strip.names |
a logical vector of length 2, indicating whether or not the name of the conditioning variable that corresponds to the strip being drawn is to be written on the strip. The two components give the values for factors and shingles respectively. This argument is ignored for a factor when |
strip.levels |
a logical vector of length 2, indicating whether or not the level of the conditioning variable that corresponds to the strip being drawn is to be written on the strip. The two components give the values for factors and shingles respectively. |
sep |
character or expression, serving as a separator if the name and level are both to be shown. |
style |
integer, with values 1, 2, 3, 4 and 5 currently
supported, controlling how the current level of a factor is encoded.
Ignored for shingles (actually, when The best way to find out what effect the value of Note that unlike S-PLUS, the default value of |
horizontal |
logical, specifying whether the labels etc should
be horizontal. |
par.strip.text |
list with parameters controlling the text on
each strip, with components |
bg |
strip background color. |
fg |
strip foreground color. |
... |
arguments to be passed on to |
default strip function for trellis functions. Useful
mostly because of the style
argument — non-default styles
are often more informative, especially when the names of the levels
of the factor x
are small. Traditional use is as
strip = function(...) strip.default(style=2,...)
, though
this can be simplified by the use of strip.custom
.
strip.default
is called for its side-effect, which is to draw a
strip appropriate for multi-panel Trellis conditioning plots.
strip.custom
returns a function that is similar to
strip.default
, but with different defaults for the arguments
specified in the call.
Deepayan Sarkar Deepayan.Sarkar@R-project.org
xyplot
, Lattice
## Traditional use
xyplot(Petal.Length ~ Petal.Width | Species, iris,
strip = function(..., style) strip.default(..., style = 4))
## equivalent call using strip.custom
xyplot(Petal.Length ~ Petal.Width | Species, iris,
strip = strip.custom(style = 4))
xyplot(Petal.Length ~ Petal.Width | Species, iris,
strip = FALSE,
strip.left = strip.custom(style = 4, horizontal = FALSE))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.