Learn R Programming

EnvNJ (version 0.1.3)

cos2dis: Convert Cosines Between Vectors into Pairwise Dissimilarities

Description

Converts cosines values into dissimilarities values.

Usage

cos2dis(cos)

Arguments

cos

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

Value

A triangular matrix with the distances.

Details

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

See Also

vcos()

Examples

Run this code
# NOT RUN {
data(bovids)
vectors = otu.space(bovids[, 7:11])
cosData = vcos(vectors)
disData = cos2dis(cosData)
# }

Run the code above in your browser using DataLab