get_pruningwise_nodenums: Get internal node numbers in pruningwise order

Description Usage Arguments Value Note Author(s) References See Also Examples

View source: R/BioGeoBEARS_readwrite_v1.R

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

1

Arguments

tr

A phylo tree object

Value

node_numbers_matrix A matrix of node numbers

Note

Go BEARS!

Author(s)

Nicholas J. Matzke matzke@berkeley.edu

References

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

Matzke_2012_IBS

See Also

get_lagrange_nodenums, prt

Examples

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

Example output

Loading required package: rexpokit
Loading required package: cladoRcpp
Loading required package: ape
Loading required package: phylobase

Attaching package: 'phylobase'

The following object is masked from 'package:ape':

    edges

      [,1] [,2]
 [1,]   27    1
 [2,]   27    2
 [3,]   28    3
 [4,]   28    4
 [5,]   29    5
 [6,]   29    6
 [7,]   30    7
 [8,]   30    8
 [9,]   34    9
[10,]   34   10
[11,]   35   11
[12,]   35   12
[13,]   37   13
[14,]   37   14
[15,]   26   15
[16,]   26   16
[17,]   33   17
[18,]   33   18

BioGeoBEARS documentation built on May 29, 2017, 8:36 p.m.