Last data update: 2014.03.03

R: Plots a Tree Object
plotTreeR Documentation

Plots a Tree Object

Description

This function takes one or more 'phylo' objects and plots them.

Usage

	plotTree(trees, colors, divisions, main, sub, showTipLabel = TRUE, 
		showNodeLabel = FALSE, displayLegend = TRUE)

Arguments

trees

A list that contains at least one tree of type 'phylo'.

colors

A vector of colors to be applied to the branches in the plot.

divisions

A vector of numbers to be used as break points to assign different colors.

main

A custom title(s) for the plot(s). The default value is the column names.

sub

A custom subtitle for the plot.

showTipLabel

Hides the tip labels if 'FALSE' otherwise it shows all non-zero tip labels.

showNodeLabel

Hides the interior node labels if 'FALSE' otherwise it shows all non-zero node labels.

displayLegend

Enables the display of a legend of the branch colors and divisions when 'TRUE'.

Details

Notes:

  1. The phylo type is a product of the ape package and the createTrees function in this package produces a list of phylo type objects for use with this function.

  2. The values for division should directly relate to the values of your data, i.e. if your data ranges from 0 to 50000 reads you should adjust the divisions to fit your data.

Value

A plot of the tree(s).

Author(s)

Berkley Shands, Patricio S. La Rosa, Elena Deych, William D. Shannon

Examples

	data(saliva)
	
	### Creates a object of type 'phylo' for the 4th tree in 'Saliva'
	### Then plots it
	salivaTree <- createTrees(saliva, 4)
	plotTree(salivaTree, displayLegend=FALSE)

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(HMPTrees)
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/HMPTrees/plotTree.Rd_%03d_medium.png", width=480, height=480)
> ### Name: plotTree
> ### Title: Plots a Tree Object
> ### Aliases: plotTree
> 
> ### ** Examples
> 
> 	data(saliva)
> 	
> 	### Creates a object of type 'phylo' for the 4th tree in 'Saliva'
> 	### Then plots it
> 	salivaTree <- createTrees(saliva, 4)
> 	plotTree(salivaTree, displayLegend=FALSE)
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>