View source: R/distFunctions.R
polyToDistMat | R Documentation |
Calculates the distance matrix from a list coefficient matrices
polyToDistMat( coefficientMatrices, method = c("fraction", "logDiff", "wLogDiff", "pa", "ap"), numThreads = -1 )
coefficientMatrices |
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 |
distance matrix calculated from argument coefficient matrices
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) # coefficient matrices for ten trees of 20 tips coeffs <- treeToPoly(rmtree(10, 20), numThreads = 0) # distance matrix from the list of coefficient matrices d <- polyToDistMat(coeffs, method = "logDiff", numThreads = 0) # using the absence-presence method d <- polyToDistMat(coeffs, method = "ap", numThreads = 0)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.