Learn R Programming

laser (version 2.4-1)

scaleBranchingtimes: Scale Branching Times

Description

Scales a vector of branching times by a known basal divergence time.

Usage

scaleBranchingtimes(x, basal = 100)

Arguments

x
a numeric vector of branching times
basal
estimated time of the basal divergence for the clade

Value

a vector of scaled branching times

Details

This function can be used when analyzing branching times for which it is possible to estimate the basal divergence time. If branch lengths in a specified phylogenetic tree are given in units of genetic distance, but the basal divergence is estimated at Z mya, call res <- scaleBranchingtimes(x, basal = Z). Rate parameters estimated by fitting variants of birth-death models will then be in units of lineage births or deaths per million years.

Examples

Run this code
  data(plethodon)
  # suppose plethodon basal divergence occurred 23 mya:
  svec <- scaleBranchingtimes(plethodon, basal = 23)
  plotLtt(svec)
  # plots lineages through time in units of time, rather than genetic
  # distance
  
  pureBirth(svec)
  # returns speciation rate in units of lineages/million years

Run the code above in your browser using DataLab