modifiers {treats}R Documentation

Modifiers

Description

Different modifiers for the birth death process implemented in treats.

Usage

modifiers(bd.params = NULL, lineage = NULL, trait.values = NULL,
                     modify.fun = NULL)

Arguments

bd.params

A named list of birth death parameters (see details).

lineage

A named list containing the lineage data (see details).

trait.values

A matrix containing the trait values (see details).

modify.fun

A list of internals functions that can modified by events (see details).

Details

bd.params can be either a named list of parameter values (e.g. list("extinction" = 0, "speciation" = 1)) but it is typically handled internally from a "treats" "bd.params" object.

modifiers are functions passed to the birth death process in treats to either generate the branch length (named branch.length and similar) or to decide whether to speciate or go extinct (named speciation and similar).

For user defined functions, the modifiers must have at least the arguments described above. For safety, we suggest setting these arguments to NULL.

The pre-build modifiers in the treats package are (so far):

More details about the modifiers functions is explained in the treats manual: http://tguillerme.github.io/treats.

Value

These functions returns either "numeric" or "logical" values to be passed to make.modifiers and treats.

Author(s)

Thomas Guillerme

See Also

treats make.modifiers

Examples

## These functions should be fed to the make.modifiers function to create
## modifiers for treats objects. For example, the following sets specifies that
## the branch length should be generated using the branch.length.trait function
## the selection using the selection function and the speciation using the
## speciation.trait function:
my_modifiers <- make.modifiers(branch.length = branch.length.trait,
                               selection     = selection,
                               speciation    = speciation.trait)

## Creating a treats simulation using these modifiers
treats(stop.rule = list(max.taxa = 20),
     traits = make.traits(),
     modifiers = my_modifiers)


[Package treats version 1.0 Index]