cosine: Compute the Cosine Similarity between the Columns of a Data...

View source: R/cosine.R

cosineR Documentation

Compute the Cosine Similarity between the Columns of a Data Set

Description

Given a dataset, compute the cosine similarity between to columns for use in optimization of Dimensional Anchors

Usage

cosine(mat)

Arguments

mat

A matrix or data.frame

Details

implementation by ekstroem (see StackOverflow for details)

Value

A symmetrical matrix with as many rows as there are columns in input

Author(s)

Yann Abraham

David Ruau

Examples

data(iris)
das <- c('Sepal.Length','Sepal.Width','Petal.Length','Petal.Width')
mat <- iris[,das]
sim.mat <- cosine(mat)
ncol(mat)
dim(sim.mat)


yannabraham/Radviz documentation built on April 3, 2022, 1:30 p.m.