Skip to contents

Computes the cosine dissimilarity between two numeric vectors.

Usage

distance_cosine_cpp(x, y)

Arguments

x

(required, numeric vector).

y

(required, numeric vector) of same length as x.

Value

numeric

Examples

distance_cosine_cpp(c(0.2, 0.4, 0.5), c(0.1, 0.8, 0.2))
#> [1] 0.2103732