vdis: Compute Pairwise Distances Between Vectors

Description Usage Arguments Details Value See Also Examples

View source: R/envnj.R

Description

Computes pairwise distances between vectors.

Usage

1

Arguments

cos

a square upper triangular matrix where cos(i,j) is the cosine between the vector i and j.

Details

Cosines are standard measure of vector similarity, and can be converted into distance by dij = -log( (1 + cos(i,j) )/2).

Value

A triangular matrix with the distances.

See Also

vcos()

Examples

1
2
3
4
data(bovids)
vectors = otu.space(bovids[, 7:11])
cosData = vcos(vectors)
disData = suppressWarnings(vdis(cosData))

EnvNJ documentation built on Sept. 27, 2021, 5:07 p.m.

Related to vdis in EnvNJ...