single_summary | R Documentation |
This function analyzes a specified categorical variable, question
,
optionally grouping by another variable, group_by
. Counts and frequencies
are computed, taking into account provided survey weights. Subgroups can be
excluded, and NAs can be removed if necessary.
single_summary(
dataset,
question,
group_by = NULL,
subgroups_to_exclude = NULL,
weights = NULL,
na.rm
)
dataset |
The input dataframe (or tibble) of survey questions |
question |
The categorical variable of interest for which frequencies and counts will be calculated, can be selected by using tidyselect semantics |
group_by |
Optional variable to group the analysis. If provided, the frequencies and counts will be calculated within each subgroup. |
subgroups_to_exclude |
Optional vector specifying subgroups to exclude from the analysis. |
weights |
Optional variable containing survey weights. If provided, frequencies and counts will be weighted accordingly. |
na.rm |
Logical indicating whether to remove NA values from |
A tabled data frame with counts and frequencies for the specified variable and optional grouping variable. The output is pre-processed, considering subgroup exclusions, NA removal, and survey weights if provided.
Other single-choice questions:
single_freq()
,
single_table()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.