summarize.trends: Summarize trends in the congruence class

Description Usage Arguments Value Examples

View source: R/summarize.trends.R

Description

Summarize trends in the congruence class

Usage

1
2
summarize.trends(model_set, threshold = 0.005, rate_name = "lambda", 
return_data = FALSE, rm_singleton = FALSE, relative_deltas = FALSE, group_names = NULL)

Arguments

model_set

an object of type "ACDCset"

threshold

a threshold for when Δ λ i should be interpreted as decreasing, flat, or increasing

rate_name

either "lambda" or "mu" or "delta"

return_data

instead of plots, return the plotting dataframes

rm_singleton

whether or not to remove singletons. Pass starting at present, going towards ancient

relative_deltas

whether to divide Δ λ i by the local lambda value

group_names

a vector of prefixes, if you want to group the models in a facet. For example 'c("reference", "model")'

Value

a patchwork object

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
data(primates_ebd)
lambda <- approxfun(primates_ebd$time, primates_ebd$lambda)
mu <- approxfun(primates_ebd$time, primates_ebd$mu)
times <- seq(0, max(primates_ebd$time), length.out = 500)

reference <- create.model(lambda, mu, times = times)

mus <- list(function(t) exp(0.01*t) - 0.01*t - 0.9,
            function(t) exp(-0.02*t) - 0.2,
            function(t) exp(-0.07*t) + 0.02*t - 0.5,
            function(t) 0.2 + 0.01*t,
            function(t) 0.2)


model_set <- congruent.models(reference, mus = mus)

p <- summarize.trends(model_set, 0.02)

ACDC documentation built on Jan. 13, 2022, 1:08 a.m.