tidy_zip: Clean up zip codes

Description Usage Arguments

Description

Remove dashes etc. (including characters!) from zip codes, zero-pad so that they are the correct length. Please note this function is only designed to deal with American-style zip codes. You can adjust the (length) argument for numeric zip codes that are longer/shorter than 5 digits, but any non-digit will be dropped. Further, this function ignores/strips out the +4 part of the zip code if it is there.

Usage

1

Arguments

zip

a vector of zip codes

length

length of the output string. The zip code will be zero-padded from the left until it is long enough


tarakc02/preprocessr documentation built on May 31, 2019, 3:55 a.m.