node.paths: Tracing nodes along paths

View source: R/node.paths.R

node.pathsR Documentation

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)

Arguments

tree

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

vec

a vector of node numbers

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.

Author(s)

Silvia Castiglione, Pasquale Raia

Examples

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)

RRphylo documentation built on May 9, 2022, 9:08 a.m.