pairwiseOverlapDistance: Calculate pairwise overlap coefficients between each pair of...

Description Usage Arguments Value Examples

View source: R/jaccardIndex.R

Description

Calculate pairwise overlap coefficients between each pair of items in a list

Usage

1
2
3

Arguments

list

A list

Value

A symmetric matrix of dimension mxm, where m is the length of the list

pairwiseOverlapDistance is defined the pairwise overlap distance.

Examples

1
2
3
4
5
6
7
8
myList <- list(first=LETTERS[3:5], second=LETTERS[1:3], third=LETTERS[1:5], fourth=LETTERS[6:10])
pairwiseOverlapCoefficient(myList)
pairwiseOverlapDistance(myList)

poormanPOC <- function(list) {
  sapply(list, function(x) sapply(list, function(y) overlapCoefficient(x,y)))
}
stopifnot(identical(pairwiseOverlapCoefficient(myList), poormanPOC(myList)))

ribiosUtils documentation built on March 13, 2020, 2:54 a.m.