View source: R/distFunctions.R
polyDist | R Documentation |
Calculates the distance between two coefficient matrices or a coefficient matrix and a list of coefficient matrices.
polyDist( x, Y, method = c("fraction", "logDiff", "wLogDiff", "pa", "ap"), numThreads = -1 )
x |
single coefficient matrix to find distances to |
Y |
a list of coefficient matrices |
method |
method to use when calculating coefficient distances:
|
numThreads |
number of threads to be used, the default (-1) will use the number of cores in the machine and numThreads = 0 will only use the main thread |
vector of distances
the substituted y coefficient vector only supports the “logDiff” method and the “fraction” method
“pa” and “ap” force symmetry in the output distance matrix
library(treenomial) library(ape) # distance between coefficient matrices of one 10 tip tree # and 100 trees with 30 tips using # create the coefficient matrices tenTipTree <- rtree(10) tenTipTreeCoeff <- treeToPoly(tenTipTree, numThreads = 0) thirtyTipList <- rmtree(100, 30) thirtyTipCoeffs <- treeToPoly(thirtyTipList, numThreads = 0) # find the distance polyDist(tenTipTreeCoeff, thirtyTipCoeffs, numThreads = 0)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.