0

我想绘制分组结果(使用李克特图),但组顺序应保留最高百分比。我已经检查了这个问题一段时间,并没有找到任何可行的解决方案。我知道这个包使用 ggplot,但由于未知原因(可能是我的限制),重新排序功能无法正常工作。

所需的情节和代码如下。谢谢 想要的情节

pilot_ds <- structure(list(time = c(".Second", "First", "First", "First", 
"First", "First", "First", "First", "First", "First", "First", 
"First", "First", "First", "First", ".Second", "First", "First", 
"First", "First", "First", "First", "First", "First", "First", 
".Second", "First", ".Second", "First", ".Second", ".Second", 
"First", "First", "First", "First", ".Second", "First", "First", 
"First", "First", "First", ".Second", "First", "First", ".Second", 
".Second", "First", "First", "First", "First", "First", "First", 
".Second", "First", "First", ".Second", "First", "First", ".Second", 
".Second", "First", "First", ".Second", "First", "First", "First", 
"First", "First", "First", "First", ".Second", "First", ".Second", 
"First", "First", "First", "First", "First", "First", "First", 
"First", "First", "First", "First", "First", "First", "First", 
"First", ".Second", "First", "First", "First", "First", "First", 
"First", "First", "First", "First", "First", "First"), Economy = structure(c(3L, 
4L, 3L, 4L, 3L, 4L, 4L, 4L, 3L, 3L, 2L, 2L, 4L, 3L, 3L, 3L, 3L, 
2L, 4L, 2L, 3L, 2L, 3L, 4L, NA, 3L, 3L, 3L, 4L, 4L, 2L, 3L, 4L, 
4L, 3L, 3L, 3L, 3L, 3L, 3L, 4L, 3L, 3L, 3L, 3L, 2L, 3L, 4L, NA, 
4L, 3L, 4L, 3L, 1L, 3L, 2L, 2L, 2L, 3L, 3L, 2L, 2L, 3L, 4L, 3L, 
3L, 3L, 3L, 4L, 3L, 3L, 2L, 3L, NA, 4L, 3L, NA, 3L, 3L, 2L, 2L, 
3L, 3L, 3L, NA, NA, 3L, 4L, 3L, 3L, 3L, 4L, 3L, 3L, 4L, 3L, 3L, 
3L, 3L, 3L), .Label = c("Not at all", "A little", "Moderately", 
"Very much"), class = "factor"), `My personal finance` = structure(c(3L, 
3L, 3L, 4L, 2L, 4L, 4L, 3L, 2L, 3L, 2L, 3L, 4L, 2L, 3L, 3L, 2L, 
2L, 3L, 2L, 2L, 2L, 2L, 4L, NA, 3L, 3L, 3L, 3L, 2L, 2L, 3L, 3L, 
2L, 3L, 3L, 3L, 3L, 3L, 3L, 4L, 3L, 3L, 2L, 3L, 2L, 3L, 4L, NA, 
4L, 3L, 3L, 2L, 2L, 3L, 3L, 2L, 3L, 3L, 2L, 2L, 2L, 3L, 4L, 3L, 
2L, 2L, 3L, 4L, 3L, 2L, 1L, 3L, NA, 2L, 3L, NA, 2L, 2L, 1L, 4L, 
2L, 3L, 3L, NA, NA, 3L, 4L, 3L, 4L, 2L, 4L, 4L, 2L, 4L, 3L, 3L, 
2L, 3L, 3L), .Label = c("Not at all", "A little", "Moderately", 
"Very much"), class = "factor"), `My own health` = structure(c(4L, 
3L, 2L, 4L, 3L, 4L, 3L, 3L, 2L, 3L, 1L, 2L, 4L, 2L, 3L, 3L, 3L, 
2L, 1L, 1L, 3L, 2L, 4L, 4L, NA, 3L, 3L, 3L, 3L, 3L, 2L, 2L, 4L, 
3L, 3L, 3L, 3L, 3L, 3L, 3L, 4L, 3L, 3L, 1L, 2L, 3L, 3L, 3L, NA, 
4L, 3L, 3L, 3L, 3L, 4L, 2L, 1L, 4L, 3L, 3L, 2L, 2L, 2L, 4L, 4L, 
2L, 2L, 3L, 4L, 4L, 3L, 1L, 3L, NA, 3L, 4L, NA, 2L, 3L, 3L, 4L, 
3L, 3L, 2L, NA, NA, 3L, 3L, 3L, 4L, 3L, 3L, 3L, 3L, 4L, 3L, 4L, 
4L, 2L, 1L), .Label = c("Not at all", "A little", "Moderately", 
"Very much"), class = "factor"), `My friends and family health` = structure(c(4L, 
4L, 3L, 4L, 4L, 4L, 4L, 4L, 2L, 3L, 1L, 3L, 4L, 3L, 2L, 3L, 3L, 
2L, 4L, 2L, 3L, 2L, 4L, 4L, NA, 3L, 3L, 4L, 4L, 3L, 3L, 2L, 4L, 
3L, 4L, 3L, 3L, 3L, 3L, 3L, 4L, 3L, 3L, 2L, 2L, 3L, 4L, 3L, NA, 
3L, 3L, 3L, 4L, 3L, 4L, 3L, 2L, 4L, 3L, 4L, 3L, 2L, 3L, 4L, 4L, 
4L, 3L, 4L, 4L, 3L, 4L, 2L, 4L, NA, 4L, 3L, NA, 3L, 3L, 3L, 4L, 
4L, 4L, 3L, NA, NA, 3L, 4L, 3L, 4L, 3L, 3L, 3L, 3L, 4L, 3L, 4L, 
4L, 3L, 3L), .Label = c("Not at all", "A little", "Moderately", 
"Very much"), class = "factor"), `Social cohesion` = structure(c(3L, 
4L, 3L, 4L, 3L, 4L, 2L, 3L, 3L, 2L, 1L, 3L, 4L, 3L, 2L, 3L, 3L, 
2L, 3L, 1L, 2L, 2L, 3L, 4L, NA, 3L, 2L, 3L, 3L, 2L, 2L, 2L, 3L, 
2L, 3L, 3L, 3L, 3L, 1L, 3L, 4L, 3L, 3L, 2L, 2L, 3L, 4L, 3L, NA, 
4L, 3L, 3L, 3L, 2L, 3L, 2L, 2L, 4L, 3L, 3L, 3L, 2L, 2L, 4L, 3L, 
3L, 2L, 3L, 4L, 3L, 4L, 2L, 3L, NA, 4L, 3L, NA, 3L, 3L, 2L, 3L, 
3L, 3L, 2L, NA, NA, 3L, 3L, 2L, 4L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 
4L, 2L, 3L), .Label = c("Not at all", "A little", "Moderately", 
"Very much"), class = "factor"), `Food and pharmaceutical drugs` = structure(c(3L, 
4L, 2L, 4L, 3L, 3L, 2L, 3L, 3L, 3L, 1L, 2L, 4L, 2L, 1L, 3L, 2L, 
2L, 3L, 2L, 2L, 2L, 2L, 4L, NA, 4L, 2L, 3L, 2L, 4L, 1L, 2L, 2L, 
2L, 3L, 2L, 2L, 1L, 1L, 3L, 4L, 1L, 3L, 1L, 2L, 2L, 2L, 3L, NA, 
4L, 3L, 2L, 3L, 2L, 2L, 1L, 2L, 3L, 2L, 1L, 3L, 2L, 2L, 3L, 3L, 
3L, 2L, 2L, 3L, 2L, 1L, 2L, 3L, NA, 3L, 2L, NA, 2L, 3L, 3L, 4L, 
3L, 2L, 2L, NA, NA, 3L, 4L, 1L, 4L, 2L, 3L, 4L, 2L, 4L, 1L, 2L, 
3L, 3L, 3L), .Label = c("Not at all", "A little", "Moderately", 
"Very much"), class = "factor"), `Price of grocery product` = structure(c(3L, 
4L, 3L, 4L, 3L, 4L, 2L, 3L, 3L, 3L, 2L, 2L, 4L, 3L, 3L, 3L, 3L, 
2L, 3L, 2L, 2L, 2L, 3L, 4L, NA, 4L, 2L, 4L, 2L, 4L, 3L, 2L, 3L, 
2L, 3L, 3L, 3L, 3L, 2L, 3L, 4L, 2L, 3L, 3L, 1L, 3L, 3L, 3L, NA, 
4L, 3L, 2L, 4L, 1L, 2L, 3L, 2L, 2L, 3L, 2L, 2L, 2L, 3L, 4L, 4L, 
3L, 2L, 4L, 4L, 2L, 1L, 1L, 3L, NA, 3L, 2L, NA, 3L, 3L, 3L, 4L, 
2L, 2L, 2L, NA, NA, 3L, 4L, 1L, 4L, 1L, 3L, 4L, 2L, 4L, 1L, 3L, 
3L, 4L, 3L), .Label = c("Not at all", "A little", "Moderately", 
"Very much"), class = "factor"), `Stock prices` = structure(c(3L, 
4L, 2L, 4L, 3L, 3L, 1L, 3L, 3L, 3L, 2L, 2L, 4L, 3L, 2L, 3L, 1L, 
2L, 3L, 2L, 2L, 2L, 3L, 4L, NA, 3L, 3L, 2L, 1L, 4L, 2L, 1L, 3L, 
1L, 3L, 3L, 3L, 2L, 2L, 2L, 4L, 1L, 3L, 2L, 1L, 3L, 4L, 3L, NA, 
3L, 3L, 3L, 3L, 3L, 3L, 1L, 2L, 2L, 3L, 3L, 2L, 2L, 3L, 4L, 4L, 
3L, 2L, 4L, 4L, 3L, 3L, 2L, 2L, NA, 4L, 3L, NA, 3L, 2L, 1L, 4L, 
2L, 2L, 2L, NA, NA, 3L, 2L, 3L, 4L, 3L, 2L, 2L, 3L, 4L, 1L, 1L, 
3L, 2L, 3L), .Label = c("Not at all", "A little", "Moderately", 
"Very much"), class = "factor"), `Children's academic achievement` = structure(c(4L, 
4L, 2L, 1L, 4L, 3L, 3L, 4L, 4L, 3L, 1L, 1L, NA, 1L, 3L, 3L, 1L, 
2L, 2L, 2L, NA, 2L, 1L, 4L, NA, 1L, 1L, 1L, 1L, 1L, 3L, 1L, 1L, 
1L, 4L, 1L, 2L, 3L, 1L, 1L, 4L, 1L, 2L, 3L, 3L, 2L, 2L, 3L, NA, 
1L, 1L, 2L, 4L, 1L, 4L, 1L, 2L, 1L, 1L, 1L, 2L, 2L, 2L, 4L, 1L, 
1L, 2L, 4L, 3L, 1L, 2L, 1L, 4L, NA, NA, 2L, NA, 1L, 1L, 1L, 4L, 
4L, 1L, 2L, NA, NA, 3L, 1L, 4L, 1L, 2L, 4L, 1L, 3L, 4L, 1L, 1L, 
3L, 1L, 3L), .Label = c("Not at all", "A little", "Moderately", 
"Very much"), class = "factor")), class = "data.frame", row.names = c(NA, 
-100L))
likert(pilot_ds[-1], grouping = pilot_ds$time) %>% 
  plot(., centered=TRUE, 
       include.center=FALSE, 
       ordered = T)
4

0 回答 0