Description Usage Arguments Details Value See Also Examples
View source: R/fetch_zones_five_digit.R
For a given 5-digit origin and destination zip code pair, display the zone number and full response.
1 2 | fetch_zones_five_digit(origin_zip, destination_zip, show_details = FALSE,
n_tries = 3, verbose = FALSE)
|
origin_zip |
(character) A single origin zip as 5-digit character. |
destination_zip |
(character) Required destination zip as 5-digit character. |
show_details |
(boolean) Extract extra stuff from the response?
Specifically: |
n_tries |
(numeric) Number times to try the API if at first we don't succeed. |
verbose |
(boolean) Message what's going on? |
Displays the result of a query to the "Get Zone for ZIP Code Pair" tab of the USPS Zone Calc website.
If you want all destinations for a given origin, use fetch_zones_three_digit
with the first 3 digits of the origin; there you don't need to supply a destination.
A tibble with origin zip, destination zip and the USPS zone that origin-destination pair corresponds to. If show_details
is TRUE, other columns are shown.
fetch_zones_three_digit
1 2 3 4 5 6 7 8 9 10 11 12 | ## Not run:
fetch_zones_five_digit("90210", "20500")
fetch_zones_five_digit("40360", "09756",
show_details = TRUE)
# Supply multiple origins and destinations
purrr::map2_dfr(c("11238", "60647", "80205"),
c("98109", "02210", "94707"),
fetch_zones_five_digit)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.