{phslookups} standardises how to read the PHS lookup files, and it also provides a col_select argument for selecting only specific columns flexibly and efficiently. We should use this in place of all the 'manual' code throughout the profiles.
For example: Demographics/2. Demographics - SIMD.R#L62
lookups_dir <- path("/conf/linkage/output/lookups/Unicode")
# 2020
simd_2020_all <- read_rds(path(
lookups_dir,
"Deprivation",
"DataZone2011_simd2020v2.rds"
)) %>%
select(datazone2011, simd = "simd2020v2_sc_quintile")
Becomes
simd_2020_all <- get_simd_datazone(
simd_version = "2020v2",
col_select = c(datazone2011, simd = "simd2020v2_sc_quintile")
)
{phslookups}standardises how to read the PHS lookup files, and it also provides acol_selectargument for selecting only specific columns flexibly and efficiently. We should use this in place of all the 'manual' code throughout the profiles.For example: Demographics/2. Demographics - SIMD.R#L62
Becomes