This functions loads in observed and projected birth data produced by the Office of National Statistics and combines both datasets into a single tidy dataframe. Observed births can be downloaded here, and projected births can be downloaded here.

clean_and_munge_england_births(birth_path = "~/data/tb_data/UK_demographics/annual_reference_table.xls",
  projected_birth_path = "~/data/tb_data/UK_demographics/england_population_projections.xls",
  return = TRUE, save = TRUE, save_name = "england_births",
  save_path = "~/data/tb_data/tbinenglanddataclean",
  save_format = c("rds", "csv"), verbose = TRUE,
  theme_set = theme_minimal)

Arguments

birth_path

The file path to the unformated observed births data, see the description for details.

projected_birth_path

The file path to the unformated projected births data, see the description for details.

return

Logical, defaults to TRUE. Specifies whether to return cleanded data.

save

Logical, defaults to FALSE. Specifies whether to save data

save_name

A character string contaning the file name for the data to be saved under.

save_path

The filepath for the data to be saved in

save_format

A character vector specifying the format/formats to save the data into, defaults to rds. Currently csv is also supported. See save_data for details.

verbose

A logical indicating whether summary information should be provided.

theme_set

The ggplot theme to apply to the summary graphs, defaults to theme_minimal

Value

A tidy data frame containing observed and projected births for England.

Examples