polyToDistMat {treenomial} | R Documentation |
Calculates the distance matrix from a list coefficient matrices
Description
Calculates the distance matrix from a list coefficient matrices
Usage
polyToDistMat(
coefficientMatrices,
method = c("fraction", "logDiff", "wLogDiff", "pa", "ap"),
numThreads = -1
)
Arguments
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 |
Value
distance matrix calculated from argument coefficient matrices
Note
the substituted y coefficient vector only supports the “logDiff” method and the “fraction” method
-
“pa” and “ap” force symmetry in the output distance matrix
Examples
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)