Learn R Programming

phyloTop (version 1.1.1)

nodeAnalysis: Node Analysis Functions

Description

A collection of functions which analyse the properties of particular nodes of the tree.

Usage

nodeImb(tree,node)
ladderDist(tree,node)
nodeDist(tree,node)

Arguments

tree
An object of class phylo4
node
An integer specifying a node in a tree by it's nodeId

Value

  • nodeImbA numeric vector of size 2 (with integer values) giving the size (by number of nodes) of the trees descending from the node
  • ladderDistA number - the length of the ladder from that node
  • nodeDistA number - the number of steps required to get from that node to the root

Details

nodeImb (stands for node imbalance) returns the number of tip descendants below the node on the left side and the right as a vector of size 2. treeImb calculates this for every node. ladderDist (ladder distance) gives the largest ladder size (away from the root) starting from the given node. It is based on rootLaddDist. Note that ladder size is given by the number of edges it is made up of. nodeDist gives the number of steps from the root to the given node. In phylobase, Depth is how far the node if from the root taking edge length into account. I have stuck with this convention so Dist is the number of steps required.

See Also

treeImb, rootLaddDist and nodeDepth

Examples

Run this code
## Creates a random tree of class phylo4 and plots it with nodes labelled by ID
tree <- rtree4(50)
tree <- idNodeLabel(tree)
plot(tree,show.tip.label=FALSE,show.node.label=TRUE)

## Calculate the imbalance of a node
nodeImb(tree,60)

## Calculates the length of the ladder from that node
ladderDist(tree,60)

## Finds the number of steps required to get from that node to the root
nodeDist(tree,60)

Run the code above in your browser using DataLab