Type: Package
Title: Ecosystem Multifunctionality: Richness, Divergence, and Regularity
Version: 0.2.0
Date: 2026-1-8
Maintainer: Yan He <heyan@njfu.edu.cn>
Description: Analyzes and quantifies ecosystem multifunctionality with functions to calculate multifunctionality richness (MFric), multifunctionality divergence (MFdiv), and multifunctionality regularity (MFreg). These indices help assess the relationship between biodiversity and multiple ecosystem functions. For more details, see Byrnes et al. (2014) <doi:10.1111/2041-210X.12143> and Chao et al. (2024) <doi:10.1111/ele.14336>.
License: GPL-3
Encoding: UTF-8
LazyData: true
Depends: R (≥ 3.5.0)
RoxygenNote: 7.3.2
Suggests: testthat (≥ 3.0.0)
Config/testthat/edition: 3
NeedsCompilation: no
Packaged: 2026-01-08 13:16:11 UTC; Administrator
Author: Yan He [aut, cre], Rui Yang [aut], Lingfeng Mao [aut]
Repository: CRAN
Date/Publication: 2026-01-08 17:00:02 UTC

Calculate Composite Multifunctionality Index (MFK)

Description

Calculates a composite multifunctionality index based on the K index approach (Wojcik 2024), integrating three facets of multifunctionality: richness (MFric), regularity (MFreg), and divergence (MFdiv) using their geometric mean.

Usage

MFK(data, weights = NULL)

Arguments

data

A data frame or matrix where rows represent observations and columns represent ecosystem functions. Function values should be normalized to a common scale (e.g., 0-1).

weights

A numeric vector of weights for each function (column). If NULL, equal weights are assigned to all functions. Default is NULL.

Details

The composite index MFK is calculated as the geometric mean of three facets:

MFK = \sqrt[3]{MFric \times MFreg \times MFdiv}

This approach follows the K index methodology (Wojcik 2024), where the geometric mean combines multiple facets of diversity into a single integrated measure. The three facets represent:

Value

A data frame containing:

References

Wojcik, L. A., Gaedke, U., van Velzen, E., & Klauschies, T. (2025). Measuring overall functional diversity by aggregating its multiple facets: Functional richness, biomass evenness, trait evenness and dispersion. Methods in Ecology and Evolution, 16, 215–227.

See Also

MFric, MFreg, MFdiv

Examples

# Example with sample data
data <- data.frame(
  func1 = c(0.5, 0.3, 0.2),
  func2 = c(0.2, 0.4, 0.4),
  func3 = c(0.3, 0.3, 0.4)
)
rownames(data) <- c("Site1", "Site2", "Site3")

# Calculate MFK with equal weights
MFK(data)

# Calculate MFK with custom weights (emphasizing func2)
MFK(data, weights = c(1, 2, 1))



Calculate Multifunctionality Divergence (MFdiv)

Description

Multifunctionality divergence (MFdiv) quantifies the degree of functional dispersion within an ecosystem by measuring how ecosystem functions deviate from their weighted centroid. MFdiv is calculated using a weighted mean absolute deviation approach.

Usage

MFdiv(data, weights = NULL)

Arguments

data

A data frame or matrix where rows represent observations (e.g., sites, plots) and columns represent ecosystem functions. Function values should be normalized to a common scale (e.g., 0-1).

weights

A numeric vector of weights for each function (column). If NULL, equal weights are assigned to all functions. Default is NULL.

Details

To measure MFdiv quantitatively, we employ a weighted mean absolute deviation approach.

The MFdiv is calculated as:

MFdiv = 2 \times \frac{\sum_{i=1}^{n} w_i |f_i - \mu|}{\sum_{i=1}^{n} w_i}

where:

\mu = \frac{\sum_{i=1}^{n} w_i f_i}{\sum_{i=1}^{n} w_i}

This metric quantifies the average weighted deviation of each function from the community's functional centroid. The multiplication by 2 scales the values to approximately [0, 1], where:

Only positive function values (f_i > 0) are included in the calculation. Functions with zero or negative values are automatically excluded along with their corresponding weights.

Value

A data frame with one column (MFdiv) containing the multifunctionality divergence values for each observation (row) in the input data. Row names are preserved from the input data.

Examples

# Example with sample data
data <- data.frame(
  func1 = c(0.5, 0.3, 0.2),
  func2 = c(0.2, 0.4, 0.4),
  func3 = c(0.3, 0.3, 0.4)
)
rownames(data) <- c("Site1", "Site2", "Site3")

# Calculate MFdiv with equal weights
MFdiv(data)

# Calculate MFreg with custom weights (emphasizing func2)
MFdiv(data, weights = c(1, 2, 1))



Calculate Multifunctionality Regularity (MFreg)

Description

This function calculates the Multifunctionality Regularity (MFreg) for each row in a dataset. MFreg quantifies the evenness of ecosystem function distribution using a normalized Shannon entropy index. Higher values indicate more even distribution of functions, while lower values suggest dominance by fewer functions.

Usage

MFreg(data, weights = NULL)

Arguments

data

A numeric data frame or matrix where rows represent observations (e.g., sites, plots) and columns represent different ecosystem functions. Function values should be non-negative.

weights

A numeric vector of weights for each function (column) in the data. If NULL (default), equal weights of 1 are assigned to all functions. The length of the weights vector must match the number of columns in data.

Details

Multifunctionality Regularity (MFreg) quantifies the evenness of function distribution in an ecosystem. It is calculated as:

MFreg = \frac{-\sum_{i=1}^{n}\frac{w_i f_i}{\sum_{i=1}^{n}w_i f_i}\ln{\frac{w_i f_i}{\sum_{i=1}^{n}w_i f_i}}}{\ln(n)}

where fi represents the normalized performance level of function i, wi is the weight of function i, and n is the total number of functions examined.

Value

A data frame with a single column named "MFreg" containing the calculated Multifunctionality Regularity values for each row in the input data. Row names are preserved from the input data if available.

Note

Examples

# Example with sample data
data <- data.frame(
  func1 = c(0.5, 0.3, 0.2),
  func2 = c(0.2, 0.4, 0.4),
  func3 = c(0.3, 0.3, 0.4)
)
rownames(data) <- c("Site1", "Site2", "Site3")

# Calculate MFreg with equal weights
MFreg(data)

# Calculate MFreg with custom weights (emphasizing func2)
MFreg(data, weights = c(1, 2, 1))



Calculate Multifunctionality Richness (MFric)

Description

This function calculates the Multifunctionality Richness (MFric) for each row in a dataset. MFric represents the weighted average level of multiple ecosystem function indicators, reflecting the overall performance of an ecosystem across various functional metrics. Only positive function values are included in the calculation.

Usage

MFric(data, weights = NULL)

Arguments

data

A numeric data frame or matrix where rows represent observations (e.g., sites, plots) and columns represent different ecosystem functions. Function values should be non-negative, with values <= 0 excluded from calculations.

weights

A numeric vector of weights for each function (column) in the data. If NULL (default), equal weights of 1 are assigned to all functions. The length of the weights vector must match the number of columns in data.

Details

The MFric is calculated as a weighted average of function values:

MFric = \frac{\sum_{i=1}^{n} w_i f_i}{\sum_{i=1}^{n} w_i}

where f_i represents the performance level of function i (with f_i > 0), and w_i denotes the weight assigned to function i.

Value

A data frame with a single column named "MFric" containing the calculated Multifunctionality Richness values for each row in the input data. Row names are preserved from the input data if available.

Note

Examples

# Example with sample data
data <- data.frame(
  func1 = c(0.5, 0.3, 0.2),
  func2 = c(0.2, 0.4, 0.4),
  func3 = c(0.3, 0.3, 0.4)
)
rownames(data) <- c("Site1", "Site2", "Site3")

# Calculate MFric with equal weights
MFric(data)

# Calculate MFric with custom weights
MFric(data, weights = c(1, 2, 1))



Forest Functions Dataset (functions)

Description

A dataset containing 11 ecosystem functions measured across the FunDivEUROPE Exploratory Platform. This dataset represents the core ecosystem functions selected for multifunctionality analysis, focusing on variables that represent stocks of energy or matter, or process rates showing the transfer of these materials between ecosystem compartments.

Usage

functions

Format

A data frame with 209 rows and 11 columns:

productivity

Annual aboveground wood production/timber production

biomass

Aboveground tree biomass

wood_decomposition

Decomposition rate of wooden materials

litter_decomposition_all

Decomposition rate of leaf litter

total_soil_C

Total soil carbon stocks

total_soil_N

Total soil nitrogen stocks

root_biomass

Total biomass of living fine roots

NC

Soil C:N ratio (calculated from total soil carbon and nitrogen)

insect_herbivory

Insect herbivory damage rate

browser_herbivory

Mammal browsing damage rate

pathogen_activity

Pathogen damage rate

Source

Baeten, L., Verheyen, K., Wirth, C., Bruelheide, H., Bussotti, F., Finér, L., Jaroszewicz B., et al. 2013. A novel comparative research platform designed to determine the functional significance of tree species diversity in European forests. Perspectives in Plant Ecology, Evolution and Systematics 15(5): 281–291.

Manning, P., van der Plas, F., Soliveres, S., Allan, E., Maestre, F. T., Mace, G., Whittingham, M., J., and Fischer, M. 2018. Redefining ecosystem multifunctionality. Nature Ecology & Evolution 2: 427–436

Scherer-Lorenzen, M., Allan, E., Ampoorter, E., Avacaritiei, D., Baeten, L., Barnoaiea, I., Bastias, C. C., et al. 2023. The functional significance of tree species diversity in European forests—the FunDivEUROPE dataset. Dryad Digital Repository.

Examples

data(functions)
head(functions)

Forest Site Information Dataset (site)

Description

A dataset containing site-level information for 209 forest plots across the FunDivEUROPE Exploratory Platform. This dataset provides essential metadata about plot location, species composition, and forest type characteristics that are used as explanatory variables in biodiversity-ecosystem function analyses.

Usage

site

Format

A data frame with 209 rows and 5 columns:

PlotID

Unique identifier for each forest plot (e.g., "FIN01", "FIN02")

Country

Country where the plot is located (e.g., "Finland", "Germany", "Italy", "Poland", "Romania", "Spain")

RestrictedSpeciesRichness

The restricted/realized tree species richness in the plot (integer values typically ranging from 1 to 5)

Composition

Species composition code indicating the tree species present in the plot. Species abbreviations follow a standardized format (e.g., "Piab.Pisy" for Picea abies and Pinus sylvestris, "Be.Piab" for Betula spp. and Picea abies)

coniferous

Proportion of coniferous trees in the plot, ranging from 0 (purely broadleaved) to 1 (purely coniferous). This represents the relative dominance of coniferous versus broadleaved species

Source

Baeten, L., Verheyen, K., Wirth, C., Bruelheide, H., Bussotti, F., Finér, L., Jaroszewicz B., et al. 2013. A novel comparative research platform designed to determine the functional significance of tree species diversity in European forests. Perspectives in Plant Ecology, Evolution and Systematics 15(5): 281–291.

Manning, P., van der Plas, F., Soliveres, S., Allan, E., Maestre, F. T., Mace, G., Whittingham, M., J., and Fischer, M. 2018. Redefining ecosystem multifunctionality. Nature Ecology & Evolution 2: 427–436

Scherer-Lorenzen, M., Allan, E., Ampoorter, E., Avacaritiei, D., Baeten, L., Barnoaiea, I., Bastias, C. C., et al. 2023. The functional significance of tree species diversity in European forests—the FunDivEUROPE dataset. Dryad Digital Repository.

Examples

data(site)
head(site)