View source: R/graph_age_groups.R
graph_age_groups | R Documentation |
Produces nice age groups for plotting on graphs. Different output for CDI and BSI
graph_age_groups(x, data_collection)
x |
A character vector of age groups |
data_collection |
a string giving the data collection of the labels to be converted. |
A factor with labels that can be printed in ggplot2
age_sex_pyramid
for its use in a graph.
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")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.