Learn R Programming

CEGO (version 2.4.3)

distanceSequenceLevenshtein: Levenshtein Distance forsSequences of numbers

Description

Levenshtein distance for two sequences of numbers

Usage

distanceSequenceLevenshtein(x, y)

Value

numeric distance value $$d(x,y)$$

Arguments

x

first vector (numeric vector)

y

second vector (numeric vector)

Examples

Run this code
#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)

Run the code above in your browser using DataLab