powered by
It's a function of finding the distance between two observations.
Dist(x,y,type)
A numeric number.
Numeric. A vector denoting an observation.
Integer. The type of distance between observations. 1 for Euclidean distance. 2 for Manhattan distance. 3 for maximum deviation among dimensions.
x<-rnorm(10,0,1) y<-rnorm(10,1,1) z<-rnorm(10,2,1) data<-cbind(x,y,z) Res<-Dist(data[1,],data[2,],type=1)
Run the code above in your browser using DataLab