cosineSimilarity: Cosine similarity

View source: R/refitting.R

cosineSimilarityR Documentation

Cosine similarity

Description

Row names of two data matrices (mutation contexts) are used for comparison. If the row names do not match completely, the larger set is used as reference with the smaller set expanded with zero-padding.

Usage

cosineSimilarity(A, B, diag = FALSE)

Arguments

A

Test matrix of dimension (m,a)

B

Reference matrix of dimension (m, b)

diag

Only compare column A[, i] with column B[, i] where i=1, ..., ncol(A)=ncol(B).

Value

If diag = TRUE, vector of overlap between columns of A and columns of B in one-to-one mapping; if diag = FALSE, matrix of dimension (a,b), whose elements give overlap of column a in matrix A with column b in matrix B.


mskcc/tempoSig documentation built on Feb. 3, 2023, 8:35 a.m.