plot_ClaDS_phylo: Plot a phylogeny with branch-specific values

View source: R/plot_ClaDS_phylo.R

plot_ClaDS_phyloR Documentation

Plot a phylogeny with branch-specific values

Description

Plot a phylogeny with branches colored according to branch-specific rate values

Usage

plot_ClaDS_phylo(phylo, rates, rates2 = NULL, 
                same.scale = T, main = NULL, lwd = 2, log = T, show.tip.label = F, ...)

Arguments

phylo

An object of class 'phylo'.

rates

A vector containing the branch-specific rates, in the same order as phylo$edges.

rates2

An optional second vector containing the branch-specific rates, in the same order as phylo$edges. If NULL (the default), the tree is only plotted once with the rate values from rates. If not, the tree is plotted twice, with the rate values from rates in the left panel and those from rates2 in the right panel.

same.scale

A boolean specifying whether the values from rates and rates2 are plotted with the same colorscale. Default to TRUE.

main

A title for the plot.

lwd

Width of the tree branch lengths. Default to 2.

log

A boolean specifying whether the rates values are plotted on a log scale. Default to TRUE.

show.tip.label

A boolean specifying whether the labels of the phylogeny should be displayed. Default to FALSE.

...

Optional arguments for plot.phylo.

Author(s)

O. Maliet

References

Maliet O., Hartig F. and Morlon H. 2019, A model with many small shifts for estimating species-specific diversificaton rates, Nature Ecology and Evolution, doi 10.1038/s41559-019-0908-0

See Also

sim_ClaDS

Examples

set.seed(1)

obj= sim_ClaDS( lambda_0=0.1,    
                mu_0=0.5,      
                sigma_lamb=0.7,         
                alpha_lamb=0.90,     
                condition="taxa",    
                taxa_stop = 20,    
                prune_extinct = TRUE)  

tree = obj$tree
speciation_rates = obj$lamb[obj$rates]
extinction_rates = obj$mu[obj$rates]

par(mar=c(1,1,0,0))
plot_ClaDS_phylo(tree,speciation_rates)

plot_ClaDS_phylo(tree,speciation_rates, lwd = 4, log = FALSE)


RPANDA documentation built on Oct. 24, 2022, 5:06 p.m.