powered by
Function to calculate distance between two vectors
distance(x, y, method = "cosine")
the distance value
numeric vector
distance calculation method: cosine (default), dot.prod, euclidian, manhattan, chebyshev, coassociation
x = c(1,2,3) y = c(6,4,6) distance(x,y)
Run the code above in your browser using DataLab