[R-sig-Geo] Matrix of distances (km) between Coordinates

Barry Rowlingson b.rowlingson at lancaster.ac.uk
Thu May 19 18:46:02 CEST 2011


2011/5/19 Marcelino de la Cruz <marcelino.delacruz at upm.es>:
> as.matrix(dist(corrdinates))

 For small distances near the equator yes! Don't try this if you are
studying polar bears!

 Try rdist.earth in the 'fields' package, or try transforming to a
euclidean coordinate system using spTransform before using dist.

Barry



More information about the R-sig-Geo mailing list