powered by
rdist(x1, x2)
D.ij = sqrt( sum.k (( x1[i,k] - x2[j,k]) **2 ).
FORTRAN: The default function calls FORTRAN to evaluate the distances. A pure S code version also exists: rdist.S
out<- rdist( ozone$x) # out is a 20X20 matrix. out2<- rdist( ozone$x[1:5,], ozone$x[11:20,]) #out2 is a 5X10 matrix
Run the code above in your browser using DataLab