powered by
Computes Euclidean or Manhattan distances for all pairs of points between two sets of points.
distance(m1, m2, type = "euclidean")
A distances matrix in which rows refer to origins and columns refer to destinations.
a vector referring to a set of origin point coordinates
a vector referring to a set of destination point coordinates
the type of distance to be computed. Two types are currently supported "euclidean" and "manhattan".
Stamatis Kalogirou <stamatis.science@gmail.com>
When m1 and m2 are identical, the function is equivalent to the dist function of base R.
dist
dist in stats.
m1<-cbind(c(1:10),c(1:10)) m2<-cbind(sample(20:80,4),sample(20:80,4)) d<-distance(m1,m2)
Run the code above in your browser using DataLab