cdb_flag {Rcompadre}R Documentation

Flag potential issues in matrices of a COM(P)ADRE database

Description

Adds columns to the data slot of a 'CompadreDB' object that flag potential problems in the matrix population models. These columns can subsequently be used to subset the database by logical argument.

Optional checks include:

Usage

cdb_flag(
  cdb,
  checks = c("check_NA_A", "check_NA_U", "check_NA_F", "check_NA_C", "check_zero_U",
    "check_zero_F", "check_zero_C", "check_zero_U_colsum", "check_singular_U",
    "check_component_sum", "check_ergodic", "check_irreducible", "check_primitive",
    "check_surv_gte_1")
)

Arguments

cdb

A CompadreDB object

checks

Character vector specifying which checks to run.

Defaults to all, i.e. c("check_NA_A", "check_NA_U", "check_NA_F", "check_NA_C", "check_zero_U", "check_singular_U", "check_component_sum", "check_ergodic", "check_irreducible", "check_primitive", "check_surv_gte_1")

Details

For the flag check_component_sum, a value of NA will be returned if the matrix sum of matU, matF, and matC consists only of zeros and/or NA, indicating that the matrix has not been split.

Value

Returns cdb with extra columns appended to the data slot (columns have the same names as the corresponding elements of checks) to indicate (TRUE/FALSE) whether there are potential problems with the matrices corresponding to a given row of the data.

Author(s)

Owen Jones <jones@biology.sdu.dk>

Julia Jones <juliajones@biology.sdu.dk>

Roberto Salguero-Gomez <rob.salguero@zoo.ox.ac.uk>

Danny Buss <dlb50@cam.ac.uk>

Patrick Barks <patrick.barks@gmail.com>

References

Stott, I., Townley, S., & Carslake, D. 2010. On reducibility and ergodicity of population projection matrix models. Methods in Ecology and Evolution. 1 (3), 242-252

See Also

Other data checking: cdb_check_species(), cdb_collapse(), cdb_compare(), mpm_methods

Examples

CompadreFlag <- cdb_flag(Compadre)

# only check whether matA has missing values, and whether matA is ergodic
CompadreFlag <- cdb_flag(Compadre, checks = c("check_NA_A", "check_ergodic"))

[Package Rcompadre version 1.3.0 Index]