View source: R/numericDistances.R
distanceNumericHamming | R Documentation |
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)
x |
first vector |
y |
second vector |
numeric distance value
d(x,y)
, scaled to values between 0 and 1
#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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.