plot.traitMedusa.model: Tree plotting for rates

Description Usage Arguments Value Author(s) See Also Examples

View source: R/plot.traitMedusa.model.R

Description

Plots trees with colours based on rates of trait evolution. Also provides simple coloured plotting for trait values using the ace function in the ape library.

Usage

1
2
## S3 method for class 'traitMedusa.model'
plot(x, y = NULL, ..., reconType = "rates", palette = "hotspot.colors")

Arguments

x

Output from summary.traitMedusa.

y

A matrix of trait values.

...

Other functions to pass to plot.phylo

reconType

Colour branches according to rate shifts ("rates" - requires traitMedusaObject) or ancestral state reconstruction ("picReconstruction" - requires x).

palette

Defines the colour scheme with four options: hotspot.colors (red to blue), heat.colors (yellow to red), cool.colors (blues), combi.colors (yellows to reds and blues)

Value

Returns a data frame of colours used in plot along with rate (or ancestral state) range for each colour.

Author(s)

Gavin Thomas, Mark Puttick

See Also

transformPhylo.ML, summary.traitMedusa.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
# Data and phylogeny
data(anolis.tree)
data(anolis.data)

# female SVL data
female.svl <- matrix(anolis.data[,"Female_SVL"], 
dimnames=list(rownames(anolis.data)))
input.data <- sortTraitData(phy=anolis.tree, y=female.svl, log.trait=TRUE)

# arbitarily reduce data size for speed in this example
phy.clade <- extract.clade(input.data[[1]], 182)
male.length.clade <- as.matrix(input.data[[2]][match(input.data[[1]]$tip.label, 
rownames(input.data[[2]])),])
# Identify rate shifts and print and plot results with up to one rate shifts 
# and minimum clade size of 10.
anolisSVL_MEDUSA <- transformPhylo.ML(male.length.clade, phy=phy.clade, 
model="tm1",minCladeSize=10, nSplits=1)
anolisSVL_MEDUSA_out <- summary(anolisSVL_MEDUSA, cutoff=1, AICc=FALSE)
colours <- plot(x = anolisSVL_MEDUSA_out,
reconType = "rates", type = "fan", cex=0.6, edge.width=3)

PuttickMacroevolution/motmot documentation built on June 5, 2020, 7 p.m.