0

I am using zipcodeR package to calculate distance between two zip codes. For the most part it is working well but there are some zip codes that it is not able to return the distance for. For example, I am using the following code:

zip_distance("02118", "32610")

It appears that trying to calculate any distance from the zip code "32610" returns an NA

Has anyone else encountered this problem?

Thanks, Siri

1 Answers1

0

The zip code "32610" is not valid as per is_zcta (which returns true if the given ZIP code is also a ZIP code tabulation area)

is_zcta("32610")
[1] FALSE
Nad Pat
  • 3,129
  • 3
  • 10
  • 20
  • Thank you, Nad Pat for your response. I was able to understand why certain zip codes were not working after learning about ZCTA. However, my dataset has these regular ZIP codes. I wonder if you have any suggestions for finding the distance between these non-ZCTA ZIP codes. I have gone through other posts on this topic and haven't been able to find a good solution to my problem yet. Any suggestions would be appreciated. Sincerely, Siri – red_rabbit Sep 14 '21 at 02:37
  • Sorry, but I dont have any idea, may be try to find to nearest zip code or ask a separate question. I am unaware of the US zip code system. Hope this question can give you some insight. https://stackoverflow.com/questions/6194912/zip-code-demographics-in-r – Nad Pat Sep 14 '21 at 15:10