ggplot_census_by_year_age_sex: Just a simple plot function

Description Usage Arguments Value Examples

View source: R/ggplot_census_by_year_age_sex.R

Description

Easy to do, but quicker to have it wrapped up in a plot.

Usage

1

Arguments

census

a tibble of census counts with columns year and age, and then the counts of the different sexes in columns named male, and female.

Value

ggplot_census_by_year_age_sex() returns a ggplot object which is a stacked barplot with year on the x-axis, counts on the y-axis with fill mapped to age. It is facet-gridded with sex in the columns and populations in the rows.

Examples

1
2
3
4
5
# A single population example
g <- ggplot_census_by_year_age_sex(species_1_slurped_results$census_postkill)

# a three-population example
g3 <- ggplot_census_by_year_age_sex(three_pops_with_mig_slurped_results$census_postkill)

CKMRpop documentation built on July 17, 2021, 5:07 p.m.