getSumStats: Get summary statistics for RoLE objects.

getSumStatsR Documentation

Get summary statistics for RoLE objects.

Description

Applies different summary statistics functions to 'roleExperiment', 'roleModel', or 'roleData' objects.

Usage

getSumStats(x, funs = .getDefaultSumStatsFuns(), moreArgs, ...)

## S4 method for signature 'roleData'
getSumStats(x, funs, moreArgs)

## S4 method for signature 'roleModel'
getSumStats(x, funs, moreArgs)

## S4 method for signature 'roleExperiment'
getSumStats(x, funs, moreArgs)

Arguments

x

The object to calculate summary statistics on.

funs

A named list of functions to calculate the summary statistics; can be a named list with a single function or many functions, but must be a named list of functions. If unspecified, defaults to including several standard stats. Included diversity index functions in roleR are: 'hillAbund', 'hillGenetic','hillPhylo' & 'richness'. Included raw stats functions are 'rawAbundance', 'rawSpAbundance','rawSppId','rawTraits','rawGenDiv','rawSeqs', 'rawBranchLengths' & 'rawApePhylo'.

moreArgs

An optional named list of additional arguments to pass to the functions listed in 'funs'. If given, list names must match those in 'funs'. Note: not all names in 'funs' need to appear in 'moreArgs'

...

ignored

Details

Users can define their own functions, so long as they work on any object of class 'roleData'.

Value

data.frame containing summary stats where each row is a model snapshot and each column is a summary stat requested by a function provided to 'funs'

Examples

# get the species richness 
# rich_stat <- getSumStats(model, funs = list(rich = richness))
# get many default summary stats
# stats <- getSumStats(model)


role-model/roleR documentation built on April 3, 2025, 1:06 p.m.