descendants: Descendants of an Internal Node in a Phylogeny

View source: R/descendants.R

descendantsR Documentation

Descendants of an Internal Node in a Phylogeny

Description

For any given internal node of a phylogeny, the function returns a vector containing the node numbers descending from that node.

Usage

descendants(phy, node, type = "t", ignore.tip = TRUE, labels = FALSE)

Arguments

phy

an object of class phylo.

node

an integer giving the number of the internal node.

type

a character string, may be "daughter", "internal", "terminal", "all", or any unambiguous abbreviation of these.

ignore.tip

logical, if ignore.tip = FALSE, the function will issue an error when node is not internal, otherwise the number of the corresponding terminal node will be returned.

labels

logical, determines if node labels are returned instead of node number, currently ignored unless type = "t".

Value

A vector containing terminal node numbers or tip labels.

Author(s)

Christoph Heibl

See Also

sister, noi

Examples

 # generate a random tree with 12 terminal and 11 internal nodes:
 tree <- rtree(12)
 
 # get the descendants of internal node 15:
 x <- descendants(tree, 15)

ips documentation built on May 29, 2024, 4:39 a.m.