Drop a clade from a phylogenetic tree

PCMTreeDropClade(tree, cladeRootNode, tableAncestors = NULL, X = NULL,
  returnPhylo = is.null(X), errorOnMissing = FALSE)

Arguments

tree

a phylo object

cladeRootNode

a character string denoting the label or an integer denoting a node in the tree

tableAncestors

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

X

an optional k x N matrix with trait value vectors for each tip in tree.

returnPhylo

logical indicating if only the phylo object associated with the tree after dropping the clade should be returned. Defaults to is.null(X)

errorOnMissing

logical indicating if an error should be rased if cladeRootNode is not among the nodes in tree. Default FALSE, meaning that if cladeRootNode is not a node in tree the tree (and X if returnPhylo is FALSE) is/are returned unchanged.

Value

If returnPhylo is TRUE, a phylo object associated with the remaining tree after dropping the clade, otherise, a list with two named members :

  • treethe phylo object associated with the remaining tree after dropping the clade

  • Xthe submatrix of X with columns corresponding to the tips in the remaining tree

See also

PCMTreeSpliAtNode PCMTreeDropClade