allTrees | R Documentation |
Return normal coefficient matrices, substituted y coefficient vectors, or phylo objects for all possible unordered full m-ary trees up to n tips. For binary trees (m = 2), the number of trees at each number of tips follows the Wedderburn-Etherington numbers.
allTrees(n, m = 2, type = c("default", "yEvaluated", "phylo"), y)
n |
max number of tips |
m |
max number of children for each node |
type |
one of:
|
y |
the y value to evaluate the polynomial at when type is “yEvaluated”, ignored otherwise |
list of lists containing all the trees in type format for each number of tips
only m = 2 is currently supported
library(treenomial) library(ape) # generate coefficient matrices describing the polynomials of all possible # unordered full binary trees up to 10 tips allBinTenRealCoeff <- allTrees(10, type = "phylo") # number of trees at each number of tips follows Wedderburn-Etherington numbers lengths(allBinTenRealCoeff) # phylo type example, plot all 6 tip unordered full binary trees # backup par options oldpar <- par(no.readonly =TRUE) allBinSixPhylo <- allTrees(6, type = "phylo")[[6]] par(mfrow=c(1,6)) plots <- lapply(allBinSixPhylo, function(t){ plot.phylo(ladderize(t), direction = "downwards", show.tip.label = FALSE) }) # restore par options par(oldpar)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.