View source: R/plot_domain_distribution.R
plot_domain_distribution | R Documentation |
This functions plots a count distribution of responses for a select multiple question and shows their responses distributed against some domain categorization of those response. E.g A health barriers question with several response options, however those response options can be grouped by barriers related to availability, accessibility, or quality of services. Each response option should only belong to one domain category.
plot_domain_distribution(
df,
domain_vars,
response_vars,
file_path = NULL,
wdth = NULL,
hght = NULL,
title_name = NULL
)
df |
Inputs a dataframe. |
domain_vars |
Inputs a character vector of column names for domain categories. Each domain should have its own column coded as 1/0. |
response_vars |
Inputs a character vector of column names for response categories for the select multiple question coded as 1/0. |
file_path |
Inputs an optional character value specifying the file path location to save an image of the plot. Recommended to specify as a .jpg or .png file. |
wdth |
Inputs an optional numeric value for the width of the image. |
hght |
Inputs an optional numeric value fo the height of the image. |
title_name |
Inputs an optional character value for the title of the plot. |
Returns a ggplot2 object.
## Not run: plot_domain_distribution(df, domain_vars = c("availability",
"accessibility", "quality"), response_vars = c("barrier.distance",
"barrier.nostaff", "barrier.costtransport", "barrier.rudestaff"))
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.