graph_age_groups: graph_age_groups

View source: R/graph_age_groups.R

graph_age_groupsR Documentation

graph_age_groups

Description

Produces nice age groups for plotting on graphs. Different output for CDI and BSI

Usage

graph_age_groups(x, data_collection)

Arguments

x

A character vector of age groups

data_collection

a string giving the data collection of the labels to be converted.

Value

A factor with labels that can be printed in ggplot2

See Also

age_sex_pyramid for its use in a graph.

Examples

data(age_trends_data)
head(age_trends_data)

## To get the right sorting and labels for the age groups

age_trends_data$age_group2 <- graph_age_groups(age_trends_data$age_group_new,
  data_collection = "cdi")

PublicHealthEngland/hcaidcs documentation built on Jan. 19, 2024, 8:38 a.m.