A list of all possible (including recursive) partitions of a tree

PCMTreeListAllPartitions(
  tree,
  minCladeSize,
  skipNodes = character(),
  tableAncestors = NULL,
  verbose = FALSE
)

Arguments

tree

a phylo object with set labels for the internal nodes

minCladeSize

integer indicating the minimum number of tips allowed in one part.

skipNodes

an integer or character vector indicating the ids or labels of nodes that should not be used as partition nodes. By default, this is an empty character vector.

tableAncestors

NULL (default) or an integer matrix returned by a previous call to PCMTreeTableAncestors(tree).

verbose

a logical indicating if informative messages should be printed to the console.

Value

a list of integer vectors.

Examples

set.seed(1, kind = "Mersenne-Twister", normal.kind = "Inversion") tree <- PCMTree(ape::rtree(10)) # \donttest{ PCMTreePlot(tree) + ggtree::geom_nodelab() + ggtree::geom_tiplab()
# } # list of all partitions into parts of at least 4 tips PCMTreeListAllPartitions(tree, 4)
#> [[1]] #> integer(0) #> #> [[2]] #> [1] 16 #> #> [[3]] #> [1] 13 #>
# list of all partitions into parts of at least 3 tips PCMTreeListAllPartitions(tree, 3)
#> [[1]] #> integer(0) #> #> [[2]] #> [1] 18 #> #> [[3]] #> [1] 16 #> #> [[4]] #> [1] 14 #> #> [[5]] #> [1] 18 14 #> #> [[6]] #> [1] 13 #> #> [[7]] #> [1] 18 13 #>
# list all partitions into parts of at least 3 tips, excluding the partitions # where node 16 is one of the partition nodes: PCMTreeListAllPartitions(tree, minCladeSize = 3, skipNodes = "16")
#> [[1]] #> integer(0) #> #> [[2]] #> [1] 18 #> #> [[3]] #> [1] 14 #> #> [[4]] #> [1] 18 14 #> #> [[5]] #> [1] 13 #> #> [[6]] #> [1] 18 13 #>