Skip to content

Use {phslookups} #295

Description

@Moohan

{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")
)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions