Skip to contents
library(addrsheff)

Add postcode variables

# Create a data frame with some example records
df <- tibble::tribble(
  ~name,    ~postcode,
  "SCC",    "S1 2HH",
  "Blades", "S2 4SU",
  "Owls",   "S6 1SW"
)

add_postcode_vars(
  df,
  pcd_name = "postcode",
  .admin_district = FALSE,
  .lat_long = TRUE,
  other_vars = c("admin_ward", "msoa_code")
)