Description Usage Arguments Value Examples
Calculate pairwise distances between each pair of items in a list
1 | naivePairwiseDist(list, fun = jaccardIndex)
|
list |
A list |
fun |
A function that receives two vectors (such as jaccardIndex) and returns a number (scale) |
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.
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.