Learn R Programming

svs (version 1.0.2)

dist_cosine: Compute Cosine Distances

Description

A function for computing cosine distances.

Usage

dist_cosine(x, diag = FALSE, upper = FALSE)

dist_cos(x, diag = FALSE, upper = FALSE)

Arguments

x
A numeric matrix (containing coordinates).
diag
Logical specifying whether the diagonal of the resulting distance matrix should be printed.
upper
Logical specifying whether the upper triangle of the resulting distance matrix should be printed.

Value

  • A distance matrix.

Details

The cosine distance equals 1 - the cosine similarity.