mirror of
https://github.com/agdamsbo/FreesearchR.git
synced 2026-06-19 04:27:30 +02:00
fix: as tibble to allow single variable plotting
This commit is contained in:
parent
75f2ae07b7
commit
7b0692fd17
1 changed files with 12 additions and 6 deletions
|
|
@ -22,18 +22,24 @@ plot_likert <- function(data,
|
|||
ds <- list(data)
|
||||
}
|
||||
out <- lapply(ds, \(.x) {
|
||||
.x[c(pri, sec)] |>
|
||||
# na.omit() |>
|
||||
plot_likert_single(color.palette = color.palette)
|
||||
plot_likert_single(
|
||||
data = .x,
|
||||
include = tidyselect::any_of(c(pri, sec)),
|
||||
color.palette = color.palette
|
||||
)
|
||||
})
|
||||
|
||||
wrap_plot_list(out, title = glue::glue(i18n$t("Grouped by {get_label(data,ter)}")))
|
||||
}
|
||||
|
||||
|
||||
plot_likert_single <- function(data, color.palette = "viridis") {
|
||||
ggstats::gglikert(data = data) +
|
||||
scale_fill_generate(palette=color.palette)+
|
||||
plot_likert_single <- function(data,
|
||||
include = dplyr::everything(),
|
||||
color.palette = "viridis") {
|
||||
data |>
|
||||
dplyr::as_tibble() |>
|
||||
ggstats::gglikert(include = include) +
|
||||
scale_fill_generate(palette = color.palette) +
|
||||
ggplot2::theme(
|
||||
# legend.position = "none",
|
||||
# panel.grid.major = element_blank(),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue