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