naivePairwiseDist: Calculate pairwise distances between each pair of items in a...

Description Usage Arguments Value Examples

View source: R/jaccardIndex.R

Description

Calculate pairwise distances between each pair of items in a list

Usage

1

Arguments

list

A list

fun

A function that receives two vectors (such as jaccardIndex) and returns a number (scale)

Value

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

This function is inefficient compared with matrix-based methods. It is exported just for education and for verifying results of matrix-based methods.

Examples

1
2
3
4
myList <- list(first=LETTERS[3:5], second=LETTERS[1:3], third=LETTERS[1:5], fourth=LETTERS[6:10])
naivePairwiseDist(myList, fun=jaccardIndex)
## despite of the name, any function that returns a number can work
naivePairwiseDist(myList, fun=jaccardDistance)

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