Is there any api or package in R to calculate the distance between the two locations given their lattitudes and longitudes ?
Method for calculating the distance
Hey @gurchetan1000,
I found two interesting packages -
- gmapsdistance uses Google Maps API to calculate the distance between given coordinates. You can find more detail with a bunch of examples here -
Pro - You can use different traveling modes like “driving”, “walking” or "bicycling"
Catch - You need to have an API key from gmaps.(You can get it from here)
- Also, geosphere looks promising. It has a set of different algorithms to calculate distance.
Hope this helps,
Sanad