plotTraitgram: Plot a Traitgram for Continuous Traits

View source: R/plotTraitgram.R

plotTraitgramR Documentation

Plot a Traitgram for Continuous Traits

Description

plotTraitgram plots a traitgram showing the evolution of a continuous trait. If node values are not given (i.e. the data is empirical data collected from tips, rather than simulated data), maximum-likelihood ancestral trait estimation is used to calculate node values. (Ackerly, 2009) given a tree and a set of continuous trait values.

Usage

plotTraitgram(trait, tree, main = "", conf.int = TRUE, lwd = 1.5)

Arguments

trait

A vector of continuous trait values. If the length of trait is equal to the number of tips and number of nodes, than it is presumed internal node values are given. If the length of trait is equal to the number of tips of tree then these will be treated as tip values and ancestral trait reconstruction will be used to reconstruct the missing ancestral values. If trait is not named, or if internal node values are given, then values will be presumed to be in the order of tip/node numbering in tree$edge, which for tips is the same as the ordering in tree$tip.label.

tree

A phylo object.

main

Main title of traitgram plot.

conf.int

If TRUE (the default), confidence intervals are plotted.

lwd

The line width used for branches in the figure.

Details

By default, this function will use ace from the library ape to reconstruct ancestral traits and confidence intervals using the PIC method, if internal node values (i.e. ancestral node values) are not given.

As with many functions in the paleotree library, absolute time is always decreasing, i.e. the present day is zero.

Value

Return no value, just plot the traitgram.

Note

One should probably never do ancestral trait estimation without looking at the confidence intervals, as these reconstructed estimates tend to be very uncertain.

Author(s)

David W. Bapst

References

Ackerly, D. 2009 Conservatism and diversification of plant functional traits: Evolutionary rates versus phylogenetic signal. Proceedings of the National Academy of Sciences 106(Supplement 2):19699–19706.

See Also

ace

Also see the functions traitgram in the library picante and phenogram in the library phytools.

Examples


set.seed(444)
tree <- rtree(10)
trait <- rTraitCont(tree)

#first, traitgram without conf intervals
plotTraitgram(trait,tree,conf.int = FALSE)

#now, with
plotTraitgram(trait,tree)
#not much confidence, eh?

# plotting simulated data
    # with values for ancestral nodes as input
trait <- rTraitCont(tree, ancestor = TRUE)
plotTraitgram(tree = tree,trait = trait)


paleotree documentation built on Aug. 22, 2022, 9:09 a.m.