R/combine_ons_with_lfs.R
combine_ons_with_lfs.Rd
This function takes demographic data summarised by clean_demographics_uk
and
clean_labour_force_survey
and combines it into a single tidy dataset.
Summary statistics and plots can be returned to check both datasets.
combine_ons_with_lfs(data_path = "~/data/tb_data/tbinenglanddataclean", ons_name = "E_demo_2000_2015.rds", lfs_name = "formatted_LFS_2000_2016.rds", countries = "England", return = TRUE, save = TRUE, save_name = "E_ons_lfs_2000_2016", save_path = "~/data/tb_data/tbinenglanddataclean", save_format = "rds", verbose = TRUE, theme_set = NULL)
data_path | A charater string containing the file path to the demographic data. |
---|---|
ons_name | Character string of the file name of the ONS demographic data. |
lfs_name | Character string of the file name of the LFS demographic data. |
countries | A character string, the countries to include in the dataset. By default only England is included. Note this is reliant on the data being present in the demographic datasets. |
return | Logical, defaults to |
save | Logical, defaults to |
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 |
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 |
A tidy tibble of demographic data by age between 2000 and 2015 for the specified countries for both ONS and LFS data.