I have a dataset with 6 Questions and 6 Answers ranging from 1 (very bad) to 6 (very good). This can be visualized using a likert plot. Let's assume the data looks like this:
d1<-data.frame(1=c(1,2,3,4,5,NA),2=c(1,2,3,4,5,6),3=c(1,2,3,4,5,6),4=c(1,2,3,4,5,6),5=c(1,2,3,4,5,6),6=c(1,2,3,NA,5,6))
To use likert i have to transform all numbers into factors, and somehow it only works when I transform the numbers into letters first
d1[d1[1:6,1:6]==1]<-"Level 1"
d1[d1[1:6,1:6]==2]<-"Level 2"
d1[d1[1:6,1:6]==3]<-"Level 3"
d1[d1[1:6,1:6]==4]<-"Level 4"
d1[d1[1:6,1:6]==5]<-"Level 5"
d1[d1[1:6,1:6]==6]<-"Level 6"
and then defining them as factors:
d1<-data.frame(E1=as.factor(d1$1),E2=as.factor(d1$2),E3= as.factor(d1$3),E4=as.factor(4), E5=as.factor(d1$5),E6=as.factor(d1$6))
Then is use the likert package, like so:
d2<-likert(d1)
plot(d2, ordered=F)
The output is something like this (different values)
All good and well, however, I need to include percentages for each bar. I have found the option plot.percents, which can be set to TRUE, however it does not work and isn't shown as an option even though it is written in the documentation of likert.
I have also seen this post:here, I tried it and it says there are too less dimensions ... I assume his code is made for 5 possible answers, whereas for me it's 6.