View source: R/summary_for_plots.R
forplot | R Documentation |
Function to summarise variables from CES and prepare for plotting
forplot(data, ..., out, dropna = c(FALSE, TRUE), number = c(FALSE, TRUE))
data |
A dataframe containing grouping variables and outcome variable |
... |
Grouping variable(s) |
out |
An outcome variable |
dropna |
Should NAs be dropped from dataframe? |
number |
Is the type of outcome variable numeric? |
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)
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.