Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

getDescendants

Get descendant node numbers


Description

getDescendants returns the set of node & tip numbers descended from node.

getParent returns the single parent node of a specified node number (or NULL if node is already the root).

Usage

getDescendants(tree, node, curr=NULL)
getParent(tree, node)

Arguments

tree

a phylogenetic tree as an object of class "phylo".

node

an integer specifying a node number in the tree.

curr

the set of previously stored node numbers - used in recursive function calls.

Value

The set of node and tip numbers for the nodes and tips descended from node in a vector, or for getParent the single node preceding node in the tree.

Author(s)

References

Revell, L. J. (2012) phytools: An R package for phylogenetic comparative biology (and other things). Methods Ecol. Evol., 3, 217-223.

See Also


phytools

Phylogenetic Tools for Comparative Biology (and Other Things)

v0.7-70
GPL (>= 2)
Authors
Liam J. Revell
Initial release
2020-9-19

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.