Learn R Programming

treats (version 1.0)

make.bd.params: Make birth death parameters

Description

Making bd.params objects for treats.

Usage

make.bd.params(
  speciation = NULL,
  extinction = NULL,
  joint = NULL,
  absolute = NULL,
  speciation.args = NULL,
  extinction.args = NULL,
  test = TRUE,
  update = NULL
)

Value

This function outputs a treats object that is a named list of elements handled internally by the treats function.

Arguments

speciation

The speciation parameter. Can be a single numeric value, a numeric vector or a function (default is 1).

extinction

The extinction parameter. Can be a single numeric value, a numeric vector or a function (default is 0).

joint

Logical, whether to estimate both birth and death parameter jointly with speciation > extinction (TRUE) or not (FALSE; default).

absolute

Logical, whether always return absolute values (TRUE) or not (FALSE; default).

speciation.args

If speciation is a function, any additional arguments to passed to the speciation function.

extinction.args

If speciation is a function, any additional arguments to passed to the speciation function.

test

Logical whether to test if the bd.params object will work (default is TRUE).

update

Optional, another previous "treats" "bd.params" object to update (see details).

Author

Thomas Guillerme

Details

When using update, the provided arguments (to make.bd.params) will be the ones updated in the "bd.params" object.

See Also

treats

Examples

Run this code
## A default set of birth death parameters
make.bd.params()

## Speciation is randomly picked between 1, 10 and 100
## and extinction is always 2
make.bd.params(speciation = c(1,10,100), extinction = 2)

## Speciation is a normal distribution(with sd = 0.75)
## and extinction is a lognormal distribution always lower than
## speciation (joint). Both are always positive values (absolute)
my_bd_params <- make.bd.params(speciation = rnorm,
                               speciation.args = list(sd = 0.75),
                               extinction = rlnorm,
                               joint = TRUE,
                               absolute = TRUE)
my_bd_params

## Visualising the distributions
plot(my_bd_params)


Run the code above in your browser using DataLab