I would like to assign colors according to my choice;
resp <- data.frame(replicate(50, sample(1:7, 100, replace=TRUE)))
resp <- data.frame(lapply(resp, factor, ordered=TRUE,
levels=1:7,
labels=c("Missing","Not Applicable","Strongly disagree","Disagree", "Neutral","Agree","Strongly Agree")))
resp = t(apply(resp,2,table))[,levels(resp[,1])]
I don't want to use diverge_hcl or sequential_hcl.
library(HH)
myColor <- likertColor(nc=7, ReferenceZero=5)
plot.likert(resp,as.percent=TRUE,col=myColor)
I have two columns extra named "Missing" and "Not Applicable". I need a color scheme that relates to the categories, such as:-
Is there any idea that how to apply above color scheme to my plot?
Simple answer is :
myColor <- c("light gray","gray","blue","light blue","white","pink","red")
plot.likert(resp,as.percent=TRUE,col=myColor)