modeltab {divDyn} | R Documentation

## Origination/extinction response table for statistical modelling.

### Description

This function takes an occurrence dataset and reformats it to a table that can be used as input for logistic models.

### Usage

    modeltab(x, tax, bin, taxvars = NULL, rt = FALSE, singletons = FALSE)

### Arguments

`x` | `(data.frame)` Fossil occurrence table.
`tax` | `(character)` Variable name of the occurring taxa (variable type: `factor` or `character` - such as `"genus"`)
`bin` | `(character)` Variable name of the bin numbers of the occurrences. This variable should be `numeric` and should increase as time passes by (use negative values for age estimates). The current version only supports discreet, non-negative integer interval numbers.
`taxvars` | `(character)` Taxon-specific column names of the variables that should be included in the output table. Only one entry/taxon is used, make sure that the data are clean.
`rt` | `(logical)` Should the range-through assumption be applied within the function? If set to `TRUE` then missing occurrences will be interpolated with `FALSE` values in both the `ext` and `ori` variables. .
`singletons` | `(logical)` Should single-interval taxa be removed from the final table? This is recommended, as it is impossible to get a `FALSE` response for these taxa.

### Details

Every entry in the output table corresponds to one cell in the `bin`/`tax` matrix. This function omits duplicates and concatenates two `logical` vectors (response variables) to the occurrence dataset: The `ori` vector is `TRUE` in the interval when the taxon first appeared, and `FALSE` in all others. The `ext` vector is `TRUE` in the interval the taxon appeared for the last time, and `FALSE` in the rest.

### Examples

    # load necessary data
    data(corals)
    # simple table
    modTab<-modeltab(corals, bin="stg", tax="genus", taxvars=c("ecology", "family"))

[Package divDyn version 0.8.0 Index]