Rev 4770 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed
\name{D_strip.default}\alias{strip.default}\alias{strip.custom}\title{Default Trellis Strip Function}\usage{strip.default(which.given,which.panel,% packet.number,% panel.number,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(\dots)}\description{\code{strip.default} is the function that draws the strips by defaultin Trellis plots. Users can write their own strip functions, but mostcommonly this involves calling \code{strip.default} with a slightlydifferent arguments. \code{strip.custom} provides a convenient way toobtain new strip functions that differ from \code{strip.default} onlyin the default values of certain arguments.}\arguments{\item{which.given}{ integer index specifying which of the conditioningvariables this strip corresponds to.}\item{which.panel}{ vector of integers as long as the number ofconditioning variables. The contents are indices specifying thecurrent levels of each of the conditioning variables (thus, thiswould be unique for each distinct packet). This is identical to thereturn value of \code{\link{which.packet}}, which is a more accuratename.}% \item{panel.number, packet.number}{ integer indices specifying which% panel and packet is being drawn (see the entry for \code{panel} in% \code{\link{xyplot}} for details). These arguments are ignored by% the \code{strip.default}, but may be used by user supplied% replacements.% }\item{var.name}{ vector of character strings or expressions as long asthe number of conditioning variables. The contents are interpretedas names for the conditioning variables. Whether they are shown onthe strip depends on the values of \code{strip.names} and\code{style} (see below). By default, the names are shown forshingles, but not for factors.}\item{factor.levels}{ vector of character strings or expressionsgiving the levels of the conditioning variable currently beingdrawn. For more than one conditioning variable, this will vary with\code{which.given}. Whether these levels are shown on the stripdepends on the values of \code{strip.levels} and \code{style} (seebelow). \code{factor.levels} may be specified for both factors andshingles (despite the name), but by default they are shown only forfactors. If shown, the labels may optionally be abbreviated byspecifying suitable components in \code{par.strip.text} (see\code{\link{xyplot}})}\item{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 \bold{printing}\code{levels(shingle)}). Otherwise, it should be \code{NULL}}\item{strip.names}{ a logical vector of length 2, indicating whetheror not the name of the conditioning variable that corresponds to thestrip being drawn is to be written on the strip. The two componentsgive the values for factors and shingles respectively.This argument is ignored for a factor when \code{style} is not oneof 1 and 3.}\item{strip.levels}{ a logical vector of length 2, indicating whetheror not the level of the conditioning variable that corresponds tothe strip being drawn is to be written on the strip. The twocomponents give the values for factors and shingles respectively.}\item{sep}{ character or expression, serving as a separator if thename and level are both to be shown.}\item{style}{ integer, with values 1, 2, 3, 4 and 5 currentlysupported, controlling how the current level of a factor is encoded.Ignored for shingles (actually, when \code{shingle.intervals} isnon-null.The best way to find out what effect the value of \code{style} hasis to try them out. Here is a short description: for a style valueof 1, the strip is colored in the background color with the striptext (as determined by other arguments) centered on it. A value of 3is the same, except that a part of the strip is colored in theforeground color, indicating the current level of the factor. Forstyles 2 and 4, the part corresponding to the current level remainscolored in the foreground color, however, for style = 2, theremaining part is not colored at all, whereas for 4, it is coloredwith the background color. For both these, the names of all thelevels of the factor are placed on the strip from left to right.Styles 5 and 6 produce the same effect (they are subtly different inS, this implementation corresponds to 5), they are similar to style1, except that the strip text is not centered, it is insteadpositioned according to the current level.Note that unlike S-PLUS, the default value of \code{style} is 1.\code{strip.names} and \code{strip.levels} have no effect if\code{style} is not 1 or 3.}\item{horizontal}{ logical, specifying whether the labels etc shouldbe horizontal. \code{horizontal=FALSE} is useful for strips on theleft of panels using \code{strip.left=TRUE} }\item{par.strip.text}{ list with parameters controlling the text oneach strip, with components \code{col}, \code{cex}, \code{font},etc.}\item{bg}{ strip background color. }\item{fg}{ strip foreground color. }\item{\dots}{arguments to be passed on to \code{strip.default}, overridingwhatever value it would have normally assumed}}\value{\code{strip.default} is called for its side-effect, which is to draw astrip appropriate for multi-panel Trellis conditioning plots.\code{strip.custom} returns a function that is similar to\code{strip.default}, but with different defaults for the argumentsspecified in the call.}\details{ default strip function for trellis functions. Usefulmostly because of the \code{style} argument --- non-default stylesare often more informative, especially when the names of the levelsof the factor \code{x} are small. Traditional use is as\code{strip = function(\dots) strip.default(style=2,\dots)}, thoughthis can be simplified by the use of \code{strip.custom}.}\seealso{\code{\link{xyplot}}, \code{\link{Lattice}}}\examples{## Traditional usexyplot(Petal.Length ~ Petal.Width | Species, iris,strip = function(..., style) strip.default(..., style = 4))## equivalent call using strip.customxyplot(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))}\author{ Deepayan Sarkar \email{Deepayan.Sarkar@R-project.org}}\keyword{dplot}