nhs-r-community / NHSRpopulation

API package to get postcode and Indices of Multiple Deprivation (IMD) data from the ONS by LSOA, currently for England.
https://nhs-r-community.github.io/NHSRpopulation/
Other
11 stars 1 forks source link

Simplify example code in vignette #48

Closed ChrisBeeley closed 3 months ago

ChrisBeeley commented 3 months ago

Getting started part of the vignette has code that could be simplified

# current method

postcodes <- c("HD1 2UT", "HD1 2UU", "HD1 2UV")

tibble_postcodes <- postcodes |>
  tibble::as_tibble() |>
  dplyr::rename(postcode = value)

# prefer?

tibble_postcodes2 <- tibble::tibble(postcode = c("HD1 2UT", "HD1 2UU", "HD1 2UV"))

# identical

identical(tibble_postcodes, tibble_postcodes2)