I am wanting to add on a summary percentage for the total positive and total negative to graphs produced using the HH likert package (as shown in the example image). My data is already formatted as a percentage and the code I am using is as follows.
The data looks like this:
Segment Very uncomfortable Quite uncomfortable Quite comfortable Very comfortable
1 Segment1 6.905055 36.991369 47.22565 5.672010
2 Segment2 2.359882 16.912488 57.91544 14.847591
3 Segment3 12.325581 12.093023 25.34884 7.674419
4 Segment4 2.560976 8.170732 27.68293 61.341463
5 Segment5 5.516014 12.900356 47.06406 32.562278
6 Segment6 36.829268 24.634146 23.65854 8.536585
And the code I am using is:
p1<-HH::likert(Segment ~ ., CD9_1_table, main="", ReferenceZero=2.5,
col=c("#F2613B", "#F69279", "#89DCCA", "#00AA86"),
xlab="", ylab="",
scales.in = list(list(col=1,tck=c(0,0)), x = list(at = seq(from = -100, to = 100, by = 50), labels = paste(seq(from=-100, to=100, by=50),'%',sep=''))),
xlimEqualLeftRight=TRUE,
par.settings.in =list(axis.line = list(col = 0)))
p2<-HH::likert(Segment ~ ., CD9_1_dk, ReferenceZero=0,main="", xlab="", ylab="",xlim=c(0,50),
col=c("grey"), scales.in = list(x = list(at = seq(from = 0, to = 50, by = 50), labels = paste(seq(from=0, to=50, by=50),'%',sep='')), y=list(labels=c("","","","","",""))),
par.settings.in =list(axis.line = list(col = 0)))
print(p1, position = c(0, 0, 0.75, 1), more = TRUE)
print(p2, position = c(0.75, 0, 1, 1))