listDD: List direct descendants for all nodes of a tree

View source: R/utils.R

listDDR Documentation

List direct descendants for all nodes of a tree

Description

The function listDD lists the direct descendants from each node of a tree. The tree can be of class phylo, phylo4 or phylo4d.

Usage

listDD(x, nameBy = c("label", "number"))

Arguments

x

A tree of class phylo, phylo4 or phylo4d.

nameBy

a character string indicating whether the returned list must be named by node labels ("label") or by node numbers ("number").

Value

A list whose components are vectors of named nodes (or tips) for a given internal node.

Author(s)

Thibaut Jombart tjombart@imperial.ac.uk

See Also

listTips which lists the tips descending from each node.

treePart which defines partitions of tips according to the tree topology.

Examples


if(require(ape) & require(phylobase)){
## make a tree
x <- as(rtree(20),"phylo4")
plot(x,show.node=TRUE)
listDD(x)
}


adephylo documentation built on Oct. 6, 2023, 5:07 p.m.