【发布时间】:2021-09-04 09:08:51
【问题描述】:
我可以使用 sjPlot R 包中的 plot_likert 函数绘制以下数据。
library(tidyverse)
df1 <-
data.frame(
matrix(
data = sample(x = c("Strongly Disagree", "Disagree", "Neutral", "Agree", "Strongly Agree"), size = 500, replace = TRUE),
ncol = 5
)
) %>%
mutate_all(., ~ ordered(., levels = c("Strongly Disagree", "Disagree", "Neutral", "Agree", "Strongly Agree")))
df1
library(sjPlot)
plot_likert(
items = df1
, cat.neutral = 3
)
我想知道如何获得以下配色方案:
Strongly Disagree = Dark Red
Disagree = Light Red
Neutral = Gray
Agree = Light Green
Strongly Agree = Dark Green
【问题讨论】: