Learn R Programming

phytools (version 2.3-0)

dotTree: Creates a phylogenetic dot plot

Description

Creates a plot in which different sized dots/circles represent different tip values for a quantitative trait.

Usage

dotTree(tree, x, legend=TRUE, method="plotTree", standardize=FALSE, ...)
dot.legend(x, y, min, max, Ntip, length=5, prompt=FALSE, method="plotTree", 
   ...)

Value

Function creates a plot.

Arguments

tree

an object of class "phylo".

x

vector of trait values; or a matrix. If x is a vector it must have names that correspond to the tip labels of tree. If x is a matrix (and it probably should be a matrix, not a data frame) then the row names of the matrix should correspond to the tip labels of the phylogeny. In the case of dot.legend, the x coordinate of the legend.

legend

logical value indicating whether or not a legend should be plotted.

method

tree plotting method to be used internally. Will switch to method="phylogram" if the number of traits is greater than one. For dot.legend, it should be the method that was used for the plot.

standardize

a logical value indicating whether or not to standardize x, or each column of x, to have a mean of zero & variance of one prior to analysis.

y

y coordinate of the legend.

min

minimum value for dot.legend.

max

maximum value for dot.legend.

Ntip

number of tips in the plotted tree for dot.legend.

length

length of legend.

prompt

logical value indicating whether or not to prompt for legend position.

...

optional arguments. In the case of dotTree, these will be passed to plotTree or a different internally used plotting function for method="phylogram". See phylo.heatmap for more detail on these arguments. Other option for dotTree also include data.type ("continuous" or "discrete"), colors, length, for data type "continuous" the length of the legend in terms of plotted circles, x.space, the spacing of the columns in the plotted data matrix, and leg.space, the spacing of the legend dots (again, for data.type="continuous" only).

Author

Liam Revell liam.revell@umb.edu

References

Revell, L. J. (2024) phytools 2.0: an updated R ecosystem for phylogenetic comparative methods (and other things). PeerJ, 12, e16505.

Examples

Run this code
## load data from Garland et al. (1992)
data(mammal.tree)
data(mammal.data)
## log-transform trait data
log.mammal<-log(mammal.data)
## plot dotTree
dotTree(mammal.tree,log.mammal,fsize=0.7,
    standardize=TRUE,length=10)
par(mar=c(5.1,4.1,4.1,2.1)) ## reset margins to default

Run the code above in your browser using DataLab