dice: Calculate the Dice distance between all columns in a matrix

Description Usage Arguments Value Examples

Description

Calculate the Dice distance between all pairs of columns in a matrix. The Dice distance is defined as the number of positions in two vectors at which the corresponding symbols or different. Here, the Dice distance is applied to the presence/absence of each gene, whereby measurements that are missing or equal to zero are considered as zeroes and all other measurements are considered as ones. This is a wrapper for the philentropy distance function, that converts a numeric matrix to a presence/absence matrix.

Usage

1
dice(mat)

Arguments

mat

a matrix of data, with samples in rows and features in columns

Value

the Dice coefficient between non-zero/missing values in each pair of columns

Examples

1
2
3
4
mat = matrix(c(1, rep(0, 9), rep(1, 4), rep(0, 6)), ncol = 2)
dice(mat)
mat = cbind(mat, c(0, rep(1, 5), rep(0, 4)))
dice(mat)

skinnider/dismay documentation built on May 6, 2019, 12:21 p.m.