Learn R Programming

ribiosUtils (version 1.7.7)

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

Description

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

Usage

pairwiseOverlapDistance(list)

pairwiseOverlapCoefficient(list)

Value

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

pairwiseOverlapDistance is defined the pairwise overlap distance.

Arguments

list

A list

Examples

Run this code

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)))

Run the code above in your browser using DataLab