View source: R/summary_for_multiple_response_plots.R
formultipleplot | R Documentation |
Function to summarise variable that allows multiple responses from CES and prepare for plotting
formultipleplot(data, ..., out)
... |
Grouping variable(s) |
out |
An outcome variable where more than one response can be selected |
A |
dataframe containing grouping variables and outcome variable |
A summary tibble in long format for ggplot of n, total and percentage (n/total) where n is frequency of each level within the outcome variable and total is the sum of n, grouped by grouping variable(s). NAs are included because this function is often applied to follow-up questions to a binary question. If NAs were excluded, reader won't know what the calculated percentage may be skewed to the readers as it becomes unclear what the percentage is expressed on.
When using function, need to specify out = otherwise function will assume it is a grouping variable
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.