View source: R/sequenceDistances.R
distanceSequenceLevenshtein | R Documentation |
Levenshtein distance for two sequences of numbers
distanceSequenceLevenshtein(x, y)
x |
first vector (numeric vector) |
y |
second vector (numeric vector) |
numeric distance value
d(x,y)
#e.g., used for distance between integer sequence
x <- c(0,1,10,2,4)
y <- c(10,1,0,4,-4)
distanceSequenceLevenshtein(x,y)
p <- replicate(10,sample(1:5,3,replace=TRUE),simplify=FALSE)
distanceMatrix(p,distanceSequenceLevenshtein)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.