View source: R/plotBranchbyTrait.R
edge.widthMap | R Documentation |
Maps a discrete character onto the edges of the tree using variable edge widths.
edge.widthMap(tree, x, ...)
## S3 method for class 'edge.widthMap'
plot(x, max.width=0.9, legend="trait value", ...)
tree |
object of class |
x |
a numerical vector of phenotypic trait values for species. |
max.width |
maximum edge width in plot units. |
legend |
label for the plot legend. |
... |
optional arguments - especially for the |
edge.widthMap
returns an object of class "edge.widthMap"
.
plot.edge.widthMap
can be used to plot this object.
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.
contMap
, fastAnc
## load data from Garland et al. (1992)
data(mammal.tree)
data(mammal.data)
## extract character of interest
ln.bodyMass<-log(setNames(mammal.data$bodyMass,
rownames(mammal.data)))
## create "edge.widthMap" object
mammal.ewMap<-edge.widthMap(mammal.tree,ln.bodyMass,
min.width=0.05)
## plot it
plot(mammal.ewMap,legend="log(body mass)")
par(mar=c(5.1,4.1,4.1,2.1)) ## reset margins to default
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.