Learn R Programming

CEGO (version 2.4.3)

distanceNumericLCStr: Longest Common Substring for Numeric Vectors

Description

Longest common substring distance for two numeric vectors, e.g., bit vectors.

Usage

distanceNumericLCStr(x, y)

Value

numeric distance value $$d(x,y)$$, scaled to values between 0 and 1

Arguments

x

first vector (numeric)

y

second vector (numeric)

Examples

Run this code
#e.g., used for distance between bit strings
x <- c(0,1,0,1,0)
y <- c(1,1,0,0,1)
distanceNumericLCStr(x,y)
p <- replicate(10,sample(c(0,1),5,replace=TRUE),simplify=FALSE)
distanceMatrix(p,distanceNumericLCStr)

Run the code above in your browser using DataLab