Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

edge.widthMap

Map continuous trait evolution on the tree


Description

Function maps a discrete character onto the edges of the tree using variable edge widths.

Usage

edge.widthMap(tree, x, ...)
## S3 method for class 'edge.widthMap'
plot(x, max.width=0.9, legend="trait value", ...)

Arguments

tree

object of class "phylo".

x

a numerical vector of phenotypic trait values for species. names(x) should contain the species names and match tree$tip.label. Or, for plot.edge.widthMap, an object of class "edge.widthMap".

max.width

maximum edge width in plot units.

legend

label for the plot legend.

...

optional arguments - especially for the plot method. Perhaps the most important of these is min.width, which defaults to 0 but could probably be increased for many datasets and graphical devices. Other arguments are passed internally to plotTree.

Value

edge.widthMap returns an object of class "edge.widthMap".

plot.edge.widthMap can be used to plot this object.

Author(s)

References

Revell, L. J. (2012) phytools: An R package for phylogenetic comparative biology (and other things). Methods Ecol. Evol., 3, 217-223.

See Also

Examples

## 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

phytools

Phylogenetic Tools for Comparative Biology (and Other Things)

v0.7-70
GPL (>= 2)
Authors
Liam J. Revell
Initial release
2020-9-19

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.