Learn R Programming

CEGO (version 2.4.3)

distanceVector: Calculate Distance Vector

Description

Calculate the distance between a single sample and all samples in a list.

Usage

distanceVector(a, X, distFun, ...)

Value

A numerical vector of distances

Arguments

a

A single sample which is a suitable input for distFun

X

list of samples, where each list element is a suitable input for distFun

distFun

Distance function of type f(x,y)=r, where r is a scalar and x and y are elements whose distance is evaluated.

...

further arguments passed to distFun

Examples

Run this code
x <- 1:5
y <- list(5:1,c(2,4,5,1,3),c(5,4,3,1,2))
distanceVector(x,y,distancePermutationHamming)

Run the code above in your browser using DataLab