Learn R Programming

RRphylo (version 3.0.0)

node.paths: Tracing nodes along paths

Description

Given a vector of nodes, the function collates nodes along individual lineages from the youngest (i.e. furthest from the tree root) to the oldest.

Usage

node.paths(tree, vec)

Value

A list of node paths, each starting from the youngest node (i.e. furthest from the tree root) and ending to the oldest along the path.

Arguments

tree

a phylogenetic tree. The tree needs not to be ultrametric and fully dichotomous.

vec

a vector of node numbers

Author

Silvia Castiglione, Pasquale Raia

Examples

Run this code
require(ape)

rtree(100)->tree
sample(seq(Ntip(tree)+1,Ntip(tree)+Nnode(tree)),20)->nods
plot(tree,show.tip.label=FALSE)
nodelabels(node=nods,frame="n",col="red")
node.paths(tree=tree, vec=nods)->np

Run the code above in your browser using DataLab