HH (version 2.3-27)

combineTwoTrellisColumns: Combine two trellis objects, each containing one column of trellis panels, into a single trellis object containing all panels.

Description

Combine two trellis objects, each containing one column of trellis panels, into a single trellis object containing all panels. This is designed specifically for displaying likert plots with percents in the first column and counts in the second column.

Usage

LikertPercentCountColumns(x, w=c(3,1), ..., positive.order=FALSE,
                          as.percent="Capture and then ignore this argument",
                          strip.lines=.8, strip.cex=.8)

combineTwoTrellisColumns(LLLRRR, w=c(1,1), strip.lines=.8, strip.cex=.7, ...)

Arguments

x
Object of class "listOfNamedMatrices", suitable for use with the plot.likert function.
w
w argument to resizePanels.
...
other arguments that can be used to update a "trellis" object.
strip.lines, strip.cex
abbreviated access to par.strip.text$lines and par.strip.text$cex.
LLLRRR
two-row matrix of "trellis" objects. The first/second row of LLLRRR contains the first/second column of the resulting trellis object. The row names of each pair of "trellis" objects must be the s
positive.order
See the discussion in likert.
as.percent
Capture this argument and ignore it. The as.percent argument of likert is TRUE in the left column and FALSE in the right column.

Value

  • A "trellis" object.

Details

Changes component values of the "trellis" object using manipulations based on those in the resizePanels package.

See Also

likert

Examples

Run this code
## These are based on the Professional Challenges example in ?likert
library(HH)
data(ProfChal)

## Change name in the "Attitude" panel
names(ProfChal)[6] <- "Prof Recog"
##
## normal usage for percents and counts displayed jointly
LikertPercentCountColumns(ProfChal,
                          main="Is your job professionally challenging?",
                          sub="LikertPercentCountColumns test, 9x8 window")
##
## Restore original name
names(ProfChal)[6] <- "Attitude
toward
Professional
Recognition"

## Same example with details illustrated for two displays with coordinated x-axis
## labels within each pair of panels.
##
LLL <- sapply(as.likert(ProfChal), plot, as.percent="noRightAxis", xlab="Percent", simplify=FALSE)
RRR <- sapply(as.likert(ProfChal), plot, rightAxis=TRUE, xlab="Count",
              scales=list(x=list(at=c(0,250,500))),
              simplify=FALSE)
LLLRRR <- rbind(Percent=LLL, Count=RRR) ## rbind is needed
dimnames(LLLRRR)[[2]][6] <- "Prof Recog"  ## original is "Attitude\ntoward\nProfessional\nRecognition"
combineTwoTrellisColumns(LLLRRR, w=c(3,1),
                         main="Is your job professionally challenging?",
                         sub="combineTwoTrellisColumns test")

Run the code above in your browser using DataCamp Workspace