sig_dist_matrix: Compute a matrix of distances / similarities between two sets...

Description Usage Arguments Value Examples

View source: R/sig_dist_matrix.R

Description

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

Usage

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

Arguments

x1

The first set of signatures (a positive matrix in which each column is a signature). The elements of x1 will be the rows of the output matrix

x2

The second set of signatures, similar data type to x1. The elements of x2 will be the columns of the output matrix

method

(as for the philentropy::distance) function.

Value

A matrix with dimensions ncol(x1) X ncol(x2) with each element representing the distance or similarity (depending on method) between the corresponding elements of x1 and x2

Examples

1
2
3
4
5
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")
gt.sigs <- matrix(c(0.21, 0.79, 0.19, 0.81), nrow = 2)
colnames(gt.sigs) <- c("gt1", "gt2")
sig_dist_matrix(ex.sigs, gt.sigs)

steverozen/ICAMSxtra documentation built on Feb. 9, 2022, 7:01 a.m.