This question already has an answer here:
- Geographic / geospatial distance between 2 lists of lat/lon points (coordinates) 2 answers
- Calculate distance between two latitude-longitude points? (Haversine formula) 35 answers
I have geocoded points in long, lat format, and I want to calculate the distance between them using R. This seems pretty straight forward, yet I can't find a function that will do it easily. I've been attempting to do it with the gdistance package, but it seems very convoluted and oriented to graphing, I just need a number. Something like distanceBetween(pointA,pointB)
that returns a number.
UPDATE: This question is specific to R, the possible dup is more general. Although there is an R specific answer, it is buried in 28 other answers.