plot_age_years_distribution: Plot Age Distribution in Years

View source: R/plot_age_years_distribution.R

plot_age_years_distributionR Documentation

Plot Age Distribution in Years

Description

This functions creates a histogram of reported ages in years.

Usage

plot_age_years_distribution(
  df,
  by_group = NULL,
  min_age = NULL,
  max_age = NULL,
  breaks = NULL,
  file_path = NULL,
  wdth = NULL,
  hght = NULL,
  title_name = NULL
)

Arguments

df

Inputs a dataframe that has been processed and standardized by the healthyr::format_nut_health_indicators and has an age_years column.

by_group

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

min_age

Inputs a numeric value for the minimum age in years to include in the plot.

max_age

Inputs a numeric value for the maximum age in years to include in the plot.

breaks

Inputs a numeric value for how many years between ticks to 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_age_years_distribution(df, by_group = "enum", min_age = 5, max_age = 100)

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