
Last chance! 50% off unlimited learning
Sale ends in
Calculate the distance between two ZIP codes in miles
zip_distance(zipcode_a, zipcode_b, lonlat = TRUE)
First ZIP code
Second ZIP code
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.
distance calculated from centroids of each ZIP code in miles
# NOT RUN {
zip_distance("08731", "08901")
# }
Run the code above in your browser using DataLab