Learn R Programming

phytools (version 2.4-4)

plotTree.lollipop: Plot a tree with one or more matched lollipop plots

Description

Plots an upward facing phylogenetic tree with one or more matched lollipop plots. Inspired by a plotting style used by Title et al. (2024).

Usage

plotTree.lollipop(tree, x, args.plotTree=list(), args.lollipop=list(), ...)

Value

Creates a plot.

Arguments

tree

an object of class "phylo".

x

a matrix, data frame, or vector of numeric values.

args.plotTree

list of arguments to be passed to plotTree.

args.lollipop

list of arguments for the lollipop plot(s).

...

optional arguments.

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.

Title, P. O., Singhal, S., Grundler, M. C., Costa, G. C., Pyron, R. A., Colston, T. J., Grundler, M. R., Prates, I., Stepanova, N., Jones, M. E. H., Cavalcanti, L. B. Q., Colli, G. R., Di-Poi, N., Donnellan, S. C., Moritz, C., Mesquita, D. O., Pianka, E. R., Smith, S. A., Vitt, L. J., and Rabosky, D. L. (2024) The macroevolutionary singularity of snakes. Science, 383, 918-923.

See Also

phylo.heatmap, plotTree.barplot

Examples

Run this code
## load tree
data(anoletree)

## convert to simple "phylo" object
anole_tree<-as.phylo(anoletree)

## load trait data
data(anole.data)

## create new data frame with size &
## residuals of other traits
anole_data<-cbind(phyl.resid(anole_tree,
    x=as.matrix(anole.data[,"SVL",drop=FALSE]),
    Y=as.matrix(anole.data[,c(6,4,2)]))$resid,
    exp(anole.data[,"SVL",drop=FALSE]))

## create plot
plotTree.lollipop(anole_tree,anole_data,
    ylab=c("relative (TL)","relative (FLL)",
        "relative (HL)","SVL"))

## reset margins to default
par(mar=c(5.1,4.1,4.1,2.1))

Run the code above in your browser using DataLab