phylo.to.map {phytools} | R Documentation |
Plot tree with tips linked to geographic coordinates
Description
Project a phylogeny on a geographic map.
Usage
phylo.to.map(tree, coords, rotate=TRUE, ...)
## S3 method for class 'phylo.to.map'
plot(x, type=c("phylogram","direct"), ...)
Arguments
tree |
an object of class |
coords |
a matrix containing the latitude (in column 1) and the longitude of all tip species in the tree. The row names should be the same as |
rotate |
a logical value indicating whether or not to rotate nodes of the tree to better match longitudinal positions. |
x |
for |
type |
a string indicating whether to map the tips of the tree onto a geographic map from a square phylogram ( |
... |
various optional arguments. For the function |
Details
phylo.to.map
creates an object of class "phylo.to.map"
and (optionally) plots that object.
plot.phylo.to.map
plots an object of class "phylo.to.map"
in which the tips of the tree point to coordinates on a geographic map.
Value
phylo.to.map
creates an object of class "phylo.to.map"
and (if plot=TRUE
) plots a phylogeny projected onto a geographic map.
plot.phylo.to.map
plots on object of class "phylo.to.map"
.
Author(s)
Liam Revell liam.revell@umb.edu
References
Revell, L. J. (2014) Graphical methods for visualizing comparative data on phylogenies. Chapter 4 in Modern phylogenetic comparative methods and their application in evolutionary biology: Concepts and practice (L. Z. Garamszegi ed.), pp. 77-103.
Revell, L. J. (2024) phytools 2.0: an updated R ecosystem for phylogenetic comparative methods (and other things). PeerJ, 12, e16505.
Examples
## generally recommend using higher resolution map
## e.g., from mapdata package
data(tortoise.tree)
data(tortoise.geog)
tortoise.phymap<-phylo.to.map(tortoise.tree,
tortoise.geog,plot=FALSE,direction="rightwards",
regions="Ecuador")
plot(tortoise.phymap,direction="rightwards",pts=FALSE,
xlim=c(-92.25,-89.25),ylim=c(-1.8,0.75),ftype="i",
fsize=0.8,lty="dashed",map.bg="lightgreen",
colors="slategrey")
## reset margins
par(mar=c(5.1,4.1,4.1,2.1))