Quantcast
Channel: Phylogenetic Tools for Comparative Biology
Viewing all articles
Browse latest Browse all 801

Projecting a continuous trait onto the branches of a tree using variable edge widths

$
0
0

Following on my prior three posts (1, 2, 3), a fourth new addition to the latest CRAN update to phytools is a method for mapping the observed and reconstructed values of a continuous character onto a tree using variable width edges: edge.widthMap.

Here's a quick demo of how it works.

First, let's load some data. This phylogenetic tree and dataset were pulled from Garland et al. (1992).

data(mammal.tree)
data(mammal.data)
lnHomeRange<-setNames(log(mammal.data$homeRange),
rownames(mammal.data))

For our next step we create our object for plotting using edge.widthMap.

object<-edge.widthMap(mammal.tree,lnHomeRange)
object
## Object of class "edge.widthMap" containing:
## (1) Phylogenetic tree with 49 tips and 48 internal nodes.
## (2) Vector of node values for a mapped quantitative
## trait.

Finally, let's make our plot.

plot(object,border=1,color=palette()[7],
legend="log(home range)")

plot of chunk unnamed-chunk-3

Some people seem to like this. I think it looks cool.


Viewing all articles
Browse latest Browse all 801

Trending Articles