zip_clean | R Documentation |
This function takes a dataframe or vector containing zip codes and convert them to the standard five-digit zip codes. Depending on the argument, it saves the subdigits.
zip_clean(df, zip_var = NULL, keep_last_four = FALSE, last_four_label = NULL)
df |
Input dataframe or vector. |
zip_var |
Variable that contains zip codes, if df is dataframe. |
keep_last_four |
Whether to keep the last four digits. |
last_four_label |
Variable to store last four digits of zip, if any. |
zip_clean( c("1000-2000", NA, "91125", "911250401", "800", "A", "100A"), zip_var = "contributor_zip", keep_last_four = TRUE, last_four_label = "contributor_zip_last4" )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.