I found something here http://www.biostat.umn.edu/~sudiptob/Software/distonearth.R
#The following program computes the distance on the surface of the earth between two points point1 and point2. Both the points are of the form (Longitude, Latitude) geodetic.distance <- function(point1, point2) { R <- 6371 p1rad <- point1 * pi/180 p2rad <- point2 * pi/180 d <- sin(p1rad[2])*sin(p2rad[2])+cos(p1rad[2])*cos(p2rad[2])*cos(abs(p1rad[1]-p2rad[1])) d <- acos(d) R*d } Dirk -- View this message in context: http://r.789695.n4.nabble.com/Geographic-distance-between-lat-long-points-in-R-tp3442338p3442355.html Sent from the R help mailing list archive at Nabble.com. ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.