# create sample data
df <- data.frame(
id = c(1:3),
zip5 = c("63005", "63139", "63636"),
zip3 = c("630", "631", "636")
)
# UDS crosswalk
# \donttest{
zi_label(df, input_var = zip5, label_source = "UDS", vintage = 2022)
# }
# USPS crosswalk
# \donttest{
zi_label(df, input_var = zip3, label_source = "USPS", type = "zip3",
vintage = 202408)
# }
# custom dictionary
## load sample ZIP3 label data to simulate custom dictionary
mo_label <- zi_mo_usps
## label
zi_label(df, input_var = zip3, label_source = mo_label, source_var = zip3,
type = "zip3")
Run the code above in your browser using DataLab