nltt_diff_exact_extinct: Calculates the exact difference between the nLTT curves of...

View source: R/nltt_diff_exact_extinct.R

nltt_diff_exact_extinctR Documentation

Calculates the exact difference between the nLTT curves of the event times. This includes extinction events.

Description

Takes branching times such as (for example) as returned by the DDD package.

Usage

nltt_diff_exact_extinct(
  event_times,
  species_number,
  event_times2,
  species_number2,
  distance_method = "abs",
  time_unit = "since",
  normalize = TRUE
)

Arguments

event_times

event times of the first phylogeny

species_number

the number of species at each event time of the first phylogeny

event_times2

event times of the second phylogeny

species_number2

the number of species at each event time of the second phylogeny

distance_method

how the difference between the two nLTTs is summed

  • "abs: "the absolute distance between the two nLTTs is summed

  • "squ: "the squared distance between the two nLTTs is summed

time_unit

the time unit of the branching times

  • "ago: "the branching times are postive, as these are in time units ago

  • "since: "the branching times are negative, as these are in time units since present

normalize

should the output be normalized? Default is TRUE.

Author(s)

Pedro Neves and Richèl Bilderbeek and Thijs Janzen

Examples


# Generate data
n <- 10
b_times_n <- (seq(1, n) / n)
lineages_n <- b_times_n
b_times2_n <- b_times_n * b_times_n
lineages2_n <- b_times2_n

# Calculate nLTT
out <- nLTT::nltt_diff_exact_extinct(
  event_times = b_times_n,
  species_number  = lineages_n,
  event_times2 = b_times2_n,
  species_number2 = lineages2_n,
  time_unit = "ago",
  distance_method = "abs"
)


richelbilderbeek/nLTT documentation built on Aug. 23, 2023, 8 a.m.