node.paths: Tracing nodes along paths

Description Usage Arguments Value Author(s) Examples

View source: R/node.paths.R

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

1
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

1
2
3
4
5
6
7
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)

pasraia/RRphylo documentation built on Aug. 6, 2021, 9:42 p.m.