View source: R/add_postcode_vars.R
add_postcode_vars | R Documentation |
Add postcode variables e.g. Ward, to a data frame with postcodes
add_postcode_vars( df, pcd_name = "postcode", .admin_district = TRUE, .lat_long = FALSE, other_vars = character(0) )
df |
data frame with a postcode variable |
pcd_name |
name of the postcode variable in passed the data frame |
.admin_district |
boolean indicating whether to add an admin_district variable |
.lat_long |
boolean indicating whether to add a pair of latitude & longitude variables |
other_vars |
character vector of other variables to add |
data frame with variables added based on postcode
# 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") )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.