View source: R/clade.members.R
clade.members | R Documentation |
Obtains a vector of the tips subtending from either one node or all nodes in a phylogeny.
clade.members(x, phy, tip.labels = FALSE, include.nodes=FALSE)
clade.members.list(phy, tips = FALSE, tip.labels = FALSE, include.nodes=FALSE)
x |
A integer identifying the node for which a list of tips is required. |
phy |
An object of class 'phylo'. |
tips |
A logical indicating whether to include external node membership in the list. |
tip.labels |
A logical flag indicating whether to return the node numbers of the tips or their tip labels. |
include.nodes |
A logical flag indicating whether to return the node number of descendent internal nodes |
The function clade.members.list
runs clade.members
over each node in the phylogeny, possibly including the external nodes as indicated by the tips argument, and returns a list of vectors showing the members of the clade defined by each node.
A numeric vector of external node (i.e. tip) numbers or a character vector of tip labels for a single internal node or, for clade.members.list
, a list of such vector for all nodes in the phylogeny. If include.nodes
is TRUE
then clade.members
returns a list of length two containing a vector of the descendent tips and a vector of the descendent internal nodes - clade.members.list
then contains a list of such lists.
David Orme, Lynsey McInnes
data(perissodactyla)
# use comparative.data to add node labels
perisso <- comparative.data(perissodactyla.tree, perissodactyla.data, Binomial, na.omit=FALSE)
plot(perisso$phy, show.node.label=TRUE)
clade.members(22, perisso$phy, tip.labels=TRUE)
clade.members.list(perisso$phy, tip.labels=FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.