plot_zscore_distribution: Plot Z-Score Distribution

View source: R/plot_zscore_distribution.R

plot_zscore_distributionR Documentation

Plot Z-Score Distribution

Description

Plot the distribution of an anthropometric z-score in order to visualize assess the distribution against a normal Gaussian curve.

Usage

plot_zscore_distribution(
  df,
  index,
  flags,
  grouping = NULL,
  file_path = NULL,
  wdth = NULL,
  hght = NULL,
  title_name = NULL
)

Arguments

df

Inputs a dataframe with anthropometric z-scores that has already been processed and standardized by the healthyr::format_nut_health_indicators function.

index

Inputs a character value for which anthropometric index to plot. Use 'wfhz' for weight-for-height, 'hfaz' for height-for-age, 'wfaz' for weight-for-age, or 'mfaz' for MUAC-for-age.

flags

Inputs a character value of 'yes' or 'no'. Yes specifies to include flagged values in the plot. No specifies to exclude flagged values in the plot.

grouping

Inputs an optional character value to facet the plot by.

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_zscore_distribution(df, index = "wfhz", file_path = "myplots/wfhz_plot.jpg",
wdth = 10, hght = 8, title_name = "Distribution of WFH Z-scores, County X")
## End(Not run)

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