sig_dist_matrix {mSigTools}R Documentation

Compute a matrix of distances / similarities between two sets of signatures.

Description

Compute a matrix of distances / similarities between two sets of signatures.

Usage

sig_dist_matrix(x1, x2, method = "cosine")

Arguments

x1

The first set of signatures (a numerical matrix-like object in which each column is a signature).

x2

The second set of signatures, similar data type to x1, and must have the same number of rows as x1.

method

As for the distance function in package philenropy.

Value

A numeric matrix with dimensions ncol(x1) X ncol(x2). Each element represents the distance or similarity (depending on method) between a column in x1 and a column in x2.

Examples

ex.sigs <- matrix(c(0.2, 0.8, 0.3, 0.7, 0.4, 0.6), nrow = 2)
colnames(ex.sigs) <- c("ex1", "ex2", "ex3")
ref.sigs <- matrix(c(0.21, 0.79, 0.19, 0.81), nrow = 2)
colnames(ref.sigs) <- c("ref1", "ref2")
sig_dist_matrix(ex.sigs, ref.sigs)


[Package mSigTools version 1.0.7 Index]