Learn R Programming

dispRity (version 1.5.0)

get.ancestors: Get ancestors

Description

Gets the list of ancestors (parents) from a tip or a node (modified from getParent)

Usage

get.ancestors(tip, tree, full = TRUE)

Arguments

tip

A tip (or node) index.

tree

A tree topology of class "phylo".

full

Whether to output the direct ancestor only (FALSE) or the full list of ancestors to the root (TRUE - default)

Value

A integer vector of ancestor(s).

See Also

ancestral.dist, nodes.coordinates, getParent

Examples

Run this code
# NOT RUN {
## A random tree
tree <- rtree(10)
## Get the ancestors of the first tip
get.ancestors(1, tree)

# }

Run the code above in your browser using DataLab