Learn R Programming

BioGeoBEARS (version 0.2.1)

get_pruningwise_nodenums: Get internal node numbers in pruningwise order

Description

There are many ways of numbering nodes in a tree. This returns a matrix containing (column 1) R's native internal numbering scheme, and (column 2) the node numbers in a pruningwise downpass. Note that this is different from LAGRANGE's downpass ordering (see get_lagrange_nodenums).

Usage

get_pruningwise_nodenums(tr)

Arguments

tr
A phylo tree object

Value

node_numbers_matrix A matrix of node numbers

References

http://phylo.wikidot.com/matzke-2013-international-biogeography-society-poster

Matzke_2012_IBS

See Also

get_lagrange_nodenums, prt

Examples

Run this code
extdata_dir = np(system.file("extdata", package="BioGeoBEARS"))
tmpdir = paste(extdata_dir,
"/examples/Psychotria_M0/LGcpp/Psychotria_5.2.newick", sep="")
trfn = np(slashslash(tmpdir))
tr = read.tree(trfn)
node_numbers_matrix = get_pruningwise_nodenums(tr)
node_numbers_matrix

Run the code above in your browser using DataLab