R/clean_munge_ETS_2016.R
clean_munge_ets_2016.Rd
A function that imports the ETS data as a stata file, converts it to rds format, cleans it to a tidy format, and finally munges required variables for future analysis. Data can be applied for here
clean_munge_ets_2016(data_path = NULL, return = TRUE, save = TRUE, save_name = "clean_ets_2016", save_path = "~/data/tb_data/tbinenglanddataclean", save_format = "rds", verbose = TRUE)
data_path | A character string containing the file pathway for the 2016 ETS data. |
---|---|
return | Logical, defaults to |
save | Logical, defaults to |
save_name | A character string containing the name to save the tidy ETS data under. |
save_path | A character string containing the file pathway to the folder into which to save the tidy ETS data for the 2016 ETS data. |
save_format | A character vector specifying the format/formats to save the data into, defaults to rds. Currently
csv is also supported. See |
verbose | A logical indicating whether summary information should be provided. |
A tidy tibble of TB notficiations in England from 2000 to 2016, with a row for each notification.
Function has 3 distinct sections:
Data Import
Setting factor variable baslines
Munge new variables