Plotting Likert Scales
Daniel Lüdecke
2020-05-23




plot_likert(
  mydf,
  c(rep("B", 4), rep("A", 5)),
  sort.groups = FALSE,
  grid.range = c(0.9, 1.1),
  geom.colors = "RdBu",
  rel_heights = c(6, 8),
  wrap.labels = 40,
  reverse.scale = TRUE
)

# control legend items
six_cat_example = data.frame(
  matrix(sample(1:6, 600, replace = TRUE), ncol = 6)
)
six_cat_example <-
  six_cat_example %>%
  dplyr::mutate_all( ~ ordered(., labels = c("+++", "++", "+", "-", "--", "---")))
# Old default
plot_likert(
  six_cat_example,
  groups = c(1, 1, 1, 2, 2, 2),
  group.legend.options = list(nrow = 2, byrow = FALSE)
)

