Last chance! 50% off unlimited learning
Sale ends in
The number of unequal elements of two vectors (which may be of unequal length), divided by the number of elements (of the larger vector).
distanceNumericHamming(x, y)
numeric distance value
first vector
second vector
#e.g., used for distance between bit strings
x <- c(0,1,0,1,0)
y <- c(1,1,0,0,1)
distanceNumericHamming(x,y)
p <- replicate(10,sample(c(0,1),5,replace=TRUE),simplify=FALSE)
distanceMatrix(p,distanceNumericHamming)
Run the code above in your browser using DataLab