Skip to contents

A wrapper function to the pyramid.plot function to create an age by sex pyramid plot

Usage

chart_age(
  x,
  save_chart = TRUE,
  filename = paste(tempdir(), "populationPyramid", sep = "/")
)

Arguments

x

Indicators dataset produced by create_op_all

save_chart

Logical. Should chart be saved? Default is TRUE.

filename

Prefix to add to output chart filename or a directory path to save output to instead of working directory. Default is a path to a temporary directory and a filename starting with populationPyramid. Ignored if save_chart is FALSE.

Value

Age by sex pyramid plot in PNG format saved in the current working directory or in a specified directory if filename is a path unless when save.plot is FALSE in which case the plot is shown on current graphics device

Examples

  # Create age by sex pyramid plot using indicators.ALL dataset
  chart_age(x = indicators.ALL)
#> Warning: NAs introduced by coercion
#> agg_png 
#>       2