Learn R Programming

HH (version 2.2-23)

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), ...,
                          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 same.

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(ProfChal[6:1], plot.likert, as.percent="noRightAxis", xlab="Percent", simplify=FALSE)
RRR <- sapply(ProfChal[6:1], plot.likert, rightAxis=TRUE, xlab="Count", simplify=FALSE)
LLLRRR <- rbind(Percent=LLL, Count=RRR) ## rbind is needed
dimnames(LLLRRR)[[2]][1] <- "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 DataLab