R-ggplot2-plot_likert-在一张图上绘制有关主题的两个不同的李克特量表

问题描述

如果有一种方法可以使用ggplot2或类似图形进行绘制,则可以节省我的时间。我有关于员工福利的规模数据。一个问题将询问福利有多重要,而下一个问题将询问员工对福利的满意程度。


dat <- structure(list(`Medical Insurance` = structure(c(3L,3L,3L),.Label = c("Neutral / Undecided","Not at all Important","Very Important"),class = "factor"),`Medical: Overall` = structure(c(3L,4L,.Label = c("Don't Use","Less Satisfied","Satisfied","Very Satisfied"),`Wellness Program` = structure(c(3L,1L,1L),`Medical: Wellness Program` = structure(c(3L,`Employee Assistance Program` = structure(c(1L,`Employee Assistance Program2` = structure(c(1L,2L,class = "factor")),row.names = c(NA,10L),class = "data.frame")

我可以分别绘制每个比例尺:

ben.imp <- dat[,seq(1,5,2)]
ben.sat <- dat[,seq(2,6,2)]

library(ggthemes)
library(stringr)
library(sjPlot)
library(sjmisc)
library(ggplot2)
library(wesanderson)

col2 <- c(wes_palettes$GrandBudapest1[2],wes_palettes$Cavalcanti1[4])

likert.ben <- plot_likert(ben.imp,cat.neutral = 1,sort.frq="neg.desc",reverse.colors=T,values = "show",show.n=F,digits=0,show.prc.sign=T,show.legend=T,geom.colors=col2,cat.neutral.color=col1[1])+  
                    theme(
                legend.title=element_text(size=14),axis.text=element_text(size=12,face="bold"),legend.text=element_text(size=12),panel.background = element_rect(fill = "transparent",colour = NA),plot.background = element_rect(fill = "transparent",#panel.border=element_blank(),panel.grid.major=element_blank(),panel.grid.minor=element_blank()
                    )+
                guides(fill = guide_legend(reverse=TRUE))+
    geom_text(size=5,position = position_dodge2(width=0.9),vjust=0)



col4 <- c("gray",wes_palettes$GrandBudapest1[2],wes_palettes$Darjeeling2[4],wes_palettes$Cavalcanti1[4])

likert.bensat <- plot_likert(ben.sat,catcount=4,geom.colors=col4,vjust=0)

但是我希望看到这样的情节:

enter image description here

那有多容易?还是我只需要在photoshop中做? :/

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)