cosine: Calculate Cosine Measures

View source: R/cosine.R

cosineR Documentation

Calculate Cosine Measures

Description

Calculate Cosine Measures

Usage

cosine(x, y)

Arguments

x

a numeric vector or matrix with column representing vector to calculate similarity.

y

must be same format as x.

Value

a numeric value or matrix.

Examples

x <- c(1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0)
y <- c(0, 0, 1, 1, 1, 1, 1, 0, 1, 0, 0, 0)
z1 <- cosine(x, y)
z1
z2 <- cosine(matrix(x), matrix(y))
z2

sigminer documentation built on Aug. 21, 2023, 9:08 a.m.