Learn R Programming

phyloTop (version 1.1.1)

treeGraphics: Tree Graphics

Description

A collection of functions to display features of trees graphically. Note that simply typing (for example) ladderShow will show the code for that function - the code can be edited to display different features or add more options.

Usage

ladderShow(tree)
configShow(tree,configSize)
subtreeShow(tree,nodeList)

Arguments

tree
An object of class phylo4.
configSize
An integer specifying the size of configuration for which to highlight.
nodeList
A numeric vector specifying a subset of the nodes of the tree by their nodeId.

Value

  • These functions have no output - they simply print the tree.

Details

ladderShow prints the tree with the ladders displayed in red. configShow prints the tree with the configurations of the required size displayed in red. subtreeShow prints the tree with the descendants of the nodes in nodeList highlighted. It is used in configShow and may be useful if you wish to write similar functions to highlight features of interest.

See Also

configurations

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)

## Plots the tree showing the ladders
ladderShow(tree)

## Plots the tree showing the 3-configurations
configShow(tree,3)

## Highlights the descendents of two particular nodes
subtreeShow(tree,c(60,90))

Run the code above in your browser using DataLab