metacommunity: Aggregate communities into a metacommunity

View source: R/metacommunity.R

metacommunityR Documentation

Aggregate communities into a metacommunity

Description

Abundances of communities are summed according to their weights to obtain the abundances of the metacommunity.

Usage

metacommunity(x, name = "metacommunity", ...)

## S3 method for class 'matrix'
metacommunity(
  x,
  name = "metacommunity",
  weights = rep(1, nrow(x)),
  as_numeric = TRUE,
  ...,
  check_arguments = TRUE
)

## S3 method for class 'abundances'
metacommunity(
  x,
  name = "metacommunity",
  as_numeric = FALSE,
  ...,
  check_arguments = TRUE
)

Arguments

x

An object of class abundances that contains several communities or a matrix of abundances with communities in rows and species in columns.

name

The name of the metacommunity

...

Unused.

weights

the weights of the sites of the species distributions.

as_numeric

if TRUE, a number or a numeric vector is returned rather than a tibble.

check_arguments

if TRUE, the function arguments are verified. Should be set to FALSE to save time when the arguments have been checked elsewhere.

Details

The total abundance of the metacommunity is by design equal to the sum of community abundances so that the information used by diversity estimators. A consequence is that equal weights lead to a metacommunity whose species abundances are the sum of community species abundances.

If community weights are not equal then the metacommunity abundances are in general not integer. Most diversity estimators can't be applied to non-integer abundances but the knowledge of the sample coverage of each community allow "ChaoShen" and "Grassberger" estimators.

Value

An object of class abundances with a single row or a named vector if as_numeric = TRUE.

Examples

metacommunity(paracou_6_abd)


divent documentation built on April 3, 2025, 7:40 p.m.