Skip to contents

Computes group-wise percent support for selected items and plots a heatmap. Note: max value in each question column is treated as "support" value.

Usage

plot_support(
  data,
  wave_col = NULL,
  weight_col = NULL,
  group_col = NULL,
  facet_by = c("variable", "group_col"),
  ques_cols = NULL,
  ques_stem = NULL,
  show_labels = TRUE
)

Arguments

data

Data frame containing the survey items.

wave_col

Column with wave identifiers (e.g., year); if missing, make bar plots.

weight_col

Weight column; if missing, equal weights are used.

group_col

Grouping column; if missing, uses a single "all" group.

facet_by

Whether to facet by variable or group.

ques_cols

Optional character vector of question columns to include.

ques_stem

Optional vector of substrings used to match columns.

show_labels

Logical; draw percentage labels on tiles.

Value

ggplot object.