微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

使用likert plot包绘图,包括组,并按最高百分比对结果进行排序

如何解决使用likert plot包绘图,包括组,并按最高百分比对结果进行排序

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

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

desired plot

pilot_ds <- structure(list(time = c(".Second","First",".Second","First"),Economy = structure(c(3L,4L,3L,2L,NA,1L,3L),.Label = c("Not at all","A little","Moderately","Very much"),class = "factor"),`My personal finance` = structure(c(3L,`My own health` = structure(c(4L,1L),`My friends and family health` = structure(c(4L,`Social cohesion` = structure(c(3L,`Food and pharmaceutical drugs` = structure(c(3L,`Price of grocery product` = structure(c(3L,`Stock prices` = structure(c(3L,`Children's academic achievement` = structure(c(4L,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)

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。