cdb_mean_matF: Calculate a population-specific mean fecundity matrix for...

View source: R/cdb_mean_matF.R

cdb_mean_matFR Documentation

Calculate a population-specific mean fecundity matrix for each set of matrices in a COM(P)ADRE database

Description

Takes a CompadreDB object and calculates a grand mean fecundity matrix for each unique population (a mean of all population-specific fecundity matrices, including fecundity matrices for which MatrixComposite == 'Mean').

Populations are defined based on unique combinations of the columns 'SpeciesAuthor', 'MatrixPopulation', and 'MatrixDimension', (or optionally, a different set of columns supplied by the user).

The main purpose of this function is to identify stage classes that are potentially reproductive (i.e. the absence of fecundity in a given stage class and year does not necessarily indicate that the stage in question is non-reproductive).

Usage

cdb_mean_matF(
  cdb,
  columns = c("SpeciesAuthor", "MatrixPopulation", "MatrixDimension")
)

Arguments

cdb

A CompadreDB object

columns

Vector of column names from which unique populations should be identified. Defaults to c("SpeciesAuthor", "MatrixPopulation", "MatrixDimension").

Value

Returns a list of matrices, representing the mean fecundity matrix associated with each row of the database.

Author(s)

Owen R. Jones <jones@biology.sdu.dk>

Danny Buss <dlb50@cam.ac.uk>

Julia Jones <juliajones@biology.sdu.dk>

Iain Stott <stott@biology.sdu.dk>

Patrick Barks <patrick.barks@gmail.com>

See Also

Other data management: cdb_flatten(), cdb_id_stages(), cdb_id_studies(), cdb_id(), cdb_rbind(), cdb_unflatten(), cdb_unnest(), mpm_elementwise_apply(), mpm_mean(), mpm_median(), mpm_sd(), string_representation

Examples

# print matF associated with row 16 of database
Compadre$mat[[16]]

# create list of meanMatFs
meanF <- cdb_mean_matF(Compadre)

# print meanMatF associated with row 16 of database
meanF[[16]]


Rcompadre documentation built on Oct. 17, 2024, 1:07 a.m.