rootToTipRegressionPlot: Plot evolutionary distance from root to sample times and...

Description Usage Arguments Value Examples

View source: R/treedater0.R

Description

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.

Usage

1
2
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

Value

The fitted linear model (class 'lm')

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
## 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)

treedater documentation built on Jan. 27, 2020, 1:06 a.m.