Hi! I was hoping I could sort in the case of a single question split on a multicategory y variable, but this is ignored. Is there a workaround not involving faceting? Same applies to gglikert_stacked.
library(ggstats)
library(dplyr)
#>
#> Attaching package: 'dplyr'
#> The following objects are masked from 'package:stats':
#>
#> filter, lag
#> The following objects are masked from 'package:base':
#>
#> intersect, setdiff, setequal, union
likert_levels <- c(
"Strongly disagree",
"Disagree",
"Neither agree nor disagree",
"Agree",
"Strongly agree"
)
df <-
tibble(
q1 = sample(likert_levels, 150, replace = TRUE),
q2 = sample(likert_levels, 150, replace = TRUE, prob = 5:1),
q3 = sample(likert_levels, 150, replace = TRUE, prob = 1:5),
indep = sample(letters[1:5], 150, replace = TRUE)
) %>%
mutate(across(-indep, ~ factor(.x, levels = likert_levels)))
gglikert(df,
include=q1,
y=indep,
sort = "ascending")
Hi! I was hoping I could sort in the case of a single question split on a multicategory y variable, but this is ignored. Is there a workaround not involving faceting? Same applies to gglikert_stacked.
Created on 2024-03-20 with reprex v2.1.0