Learn R Programming

shipunov (version 1.11)

Cosine.dist: Cosine distance

Description

Calculates cosine distance

Usage

Cosine.dist(data.x, data.y=data.x)

Arguments

data.x

Matrix with variables that should be used in the computation of the distance.

data.y

Matrix compatible with 'data.x' (optional).

Value

Distance object with distances among rows of 'data.x' and optionally those of 'data.y'

Details

If arguments are data frames, Cosine.dist() internally converts them into matrices.

On normalized data, cosine distance is essentially the same as Euclidean.

See Also

dist

Examples

Run this code
# NOT RUN {
plot(hclust(Cosine.dist(iris[!c(rep(1, 9), 0), -5])))
# }

Run the code above in your browser using DataLab