This function returns multiple incidence rate datesets, with varying age groupings. This enables more rapid interrogation of the data.

calculate_incidence_ets_lfs_ons(data_path = "~/data/tb_data/tbinenglanddataclean",
  ets_name = "clean_ets_2016.rds",
  demo_name = "E_ons_lfs_2000_2016.rds", return = TRUE, save = TRUE,
  incidence_name = "incidence",
  grouped_incidence_name = "age_grouped_incidence",
  condensed_grouped_incidence_name = "condensed_age_group_incidence",
  cases_demo_incidence_name = "cases_demo_incidence",
  save_path = "~/data/tb_data/tbinenglanddataclean",
  save_format = "rds", verbose = TRUE, theme_set = theme_minimal)

Arguments

data_path

A charater string containing the file path to the demographic data.

ets_name

A character string of the name for the cleaned ETS data.

demo_name

A character string of the name for the cleanded demographic ONS and LFS data.

return

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

save

Logical, defaults to FALSE. Specifies whether to save data

incidence_name

A character string indicating the name to save the incidence data under.

grouped_incidence_name

A character string indicating the name to save the age grouped incidence data under.

condensed_grouped_incidence_name

A character string indicating the name to save the condensed age grouped data under.

cases_demo_incidence_name

A character string indicating the name to save the cases, and demographic data 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 list of dataframes containing incidence data in an increasingly condensed format.

Examples