Skip to contents

Plot population pyramid

Usage

plot_pyr(
  popm,
  popf,
  age,
  sexn = c("Males", "Females"),
  sexc = c("#ED0000B2", "#00468BB2"),
  age.cont = FALSE
)

Arguments

popm

Numeric vector of male population

popf

Numeric vector of female population

age

Numeric vector of ages

sexn

Character array of labels for the sexes. By default = c("Males", "Females")

sexc

Character array of colors for the sexes. By default = c("#ED0000B2","#00468BB2"), which are red and blue

age.cont

Logical. Should the age axis be considered as continious scale? Recommend to switch to TRUE if the age intervals are small (1 year) and FALSE otherwise (for ex., when age interval is 5 years). By default = FALSE

Value

ggplot2 object