rootToTipRegressionPlot function

Plot evolutionary distance from root to sample times and estimated internal node times and regression lines

Plot evolutionary distance from root to sample times and estimated internal node times and regression lines

If a range of sample times was given, these will be estimated. Red and black respectively indicate sample and internal nodes. This function will print statistics computed from the linear regression model.

rootToTipRegressionPlot(td, show.tip.labels = FALSE, textopts = NULL, pointopts = NULL, ...)

Arguments

  • td: A fitted treedater object
  • show.tip.labels: If TRUE, the names of each sample will be plotted at the their corresponding time and evoutionary distance
  • textopts: An optional list of parameters for plotted tip labels. Passed to the text function.
  • pointopts: An optional list of parameters for plotted points if showing tip labels. Passed to the points function.
  • ...: Additional arguments are passed to plot

Returns

The fitted linear model (class 'lm')

Examples

## simulate a random tree and sample times for demonstration # make a random tree: tre <- ape::rtree(50) # sample times based on distance from root to tip: sts <- setNames( ape::node.depth.edgelength( tre )[1:ape::Ntip(tre)], tre$tip.label) # modify edge length to represent evolutionary distance with rate 1e-3: tre$edge.length <- tre$edge.length * 1e-3 # treedater: td <- dater( tre, sts =sts, clock='strict', s = 1000, omega0=.0015 ) # root to tip regression: fit = rootToTipRegressionPlot( td ) summary(fit)
  • Maintainer: Erik Volz
  • License: GPL-2
  • Last published: 2020-01-26

Useful links