PCMTreeListAllPartitions: A list of all possible (including recursive) partitions of a...

View source: R/PCMTree.R

PCMTreeListAllPartitionsR Documentation

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

Description

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

Usage

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))


PCMTreePlot(tree) + ggtree::geom_nodelab() + ggtree::geom_tiplab()


# list of all partitions into parts of at least 4 tips
PCMTreeListAllPartitions(tree, 4)

# list of all partitions into parts of at least 3 tips
PCMTreeListAllPartitions(tree, 3)

# 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")


PCMBase documentation built on Nov. 18, 2022, 9:06 a.m.