Learn R Programming

zipcodeR (version 0.3.2)

zip_distance: Calculate the distance between two ZIP codes in miles

Description

Calculate the distance between two ZIP codes in miles

Usage

zip_distance(zipcode_a, zipcode_b, lonlat = TRUE)

Arguments

zipcode_a

First ZIP code

zipcode_b

Second ZIP code

lonlat

lonlat argument to pass to raster::pointDistance() to select method of distance calculation. Default is TRUE to calculate distance over a spherical projection. FALSE will calculate the distance in Euclidean (planar) space.

Value

distance calculated from centroids of each ZIP code in miles

Examples

Run this code
# NOT RUN {
zip_distance("08731", "08901")
# }

Run the code above in your browser using DataLab