This calculation uses the Haversine method of computing great circle distances in kilometers on a spherical Earth (r = 6378.137 km). This code was taken from fields::rdist.earth by Doug Nychka, John Paige, Florian Gerber.
sphere_dist(coords, r = 6378.137)
distance matrix between all pairwise coordinates.
a matrix with longitudes and latitudes in decimal degrees. The longitudes should be provided in the first column (they are the x-coordinate) and the latitudes should be provided in the second column (they are the y-coordinate).
the radius of the Earth, defaults to 6378.137 km