## 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