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

Description Usage Arguments Details Value Author(s) Examples

View source: R/cosine.R

Description

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

Usage

1
cosine(mat)

Arguments

mat

A matrix or data.frame

Details

implementation by David Ruau (see https://gist.github.com/bobthecat/2903031 for details)

Value

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

Author(s)

Yann Abraham

David Ruau

Examples

1
2
3
4
5
6
7
data(iris)
das <- c('Sepal.Length','Sepal.Width','Petal.Length','Petal.Width')
mat <- iris[,das]
scaled <- apply(mat,2,do.L)
sim.mat <- cosine(scaled)
ncol(mat)
dim(sim.mat)

Radviz documentation built on May 29, 2017, 2:39 p.m.