Description Usage Arguments Value Author(s) See Also Examples
View source: R/plot.traitMedusa.model.R
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.
1 2 |
x |
Output from |
y |
A matrix of trait values. |
... |
Other functions to pass to |
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) |
Returns a data frame of colours used in plot along with rate (or ancestral state) range for each colour.
Gavin Thomas, Mark Puttick
transformPhylo.ML
, summary.traitMedusa
.
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.