View source: R/plotTree.lollipop.R
plotTree.lollipop | R Documentation |
Plots an upward facing phylogenetic tree with one or more matched lollipop plots. Inspired by a plotting style used by Title et al. (2024).
plotTree.lollipop(tree, x, args.plotTree=list(), args.lollipop=list(), ...)
tree |
an object of class |
x |
a matrix, data frame, or vector of numeric values. |
args.plotTree |
list of arguments to be passed to |
args.lollipop |
list of arguments for the lollipop plot(s). |
... |
optional arguments. |
Creates a plot.
Liam Revell liam.revell@umb.edu
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.
phylo.heatmap
, plotTree.barplot
## 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))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.