plot_vars_by_group: Plot Variables by Group

View source: R/plot_vars_by_group.R

plot_vars_by_groupR Documentation

Plot Variables by Group

Description

This function creates bar charts showing counts of responses by group.

Usage

plot_vars_by_group(
  df,
  vars,
  grouping,
  file_path = NULL,
  wdth = NULL,
  hght = NULL,
  title_name = NULL
)

Arguments

df

Inputs a dataframe.

vars

Inputs a character vector of column names to plot by group.

grouping

Inputs a character value specifying the column by which to facet the plot.

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.

Value

Returns a ggplot2 object.

Examples

## Not run: plot_vars_by_group(df, vars = c("availability", "accessibility", "quality"),
grouping = "unmet_need")
## End(Not run)

SaeedR1987/healthyr documentation built on July 4, 2023, 11:17 p.m.