Type: | Package |
Title: | Ecosystem Multifunctionality: Richness, Divergence, and Regularity |
Version: | 0.1.0 |
Date: | 2025-5-27 |
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 (≥ 2.10) |
RoxygenNote: | 7.3.2 |
Suggests: | testthat (≥ 3.0.0) |
Config/testthat/edition: | 3 |
NeedsCompilation: | no |
Packaged: | 2025-05-27 14:56:13 UTC; Administrator |
Author: | Yan He [aut, cre], Lingfeng Mao [aut] |
Repository: | CRAN |
Date/Publication: | 2025-05-29 19:40:24 UTC |
Calculate Multifunctionality Divergence (MFdiv)
Description
Multifunctionality divergence (MFdiv) was calculated to quantify the degree of difference between different functions of an ecosystem. MFdiv was calculated by the mean pairwise distance method.
Usage
MFdiv(data, weights = NULL, cor = FALSE)
Arguments
data |
A data frame or matrix where rows represent observations and columns represent functions. |
weights |
A numeric vector of weights for each function (column). If NULL, equal weights are assigned. |
cor |
Logical. If TRUE, calculates MFdiv with redundancy correction based on correlation between functions. If FALSE, calculates uncorrected MFdiv. |
Details
To measure MFdiv quantitatively, we employ the mean pairwise distance method (Webb et al., 2002).
For uncorrected MFdiv, the formula is:
MFdiv = \frac{\sum_{i=1}^{n}\sum_{j=i+1}^{n}{w_i w_j D_{ij}}}{\sum_{i=1}^{n}\sum_{j=i+1}^{n}{w_i w_j}}
where D_{ij} = |f_i - f_j|
When redundancy correction is applied ('cor = TRUE'), the function accounts for correlations between ecosystem functions. The correction process involves:
1. Calculating a distance matrix based on correlations: d_{ij} = \sqrt{1 - |r_{ij}|}
2. Applying threshold-based correction: d_{ij}(\tau) = \min(d_{ij}, \tau)
3. Computing effective function values:
F_i(\tau) = \sum_{j=1}^{L}(1 - \frac{d_{ij}(\tau)}{\tau})f_j
4. Calculating the corrected MFdiv using these effective function values:
D_{ij}(\tau) = |F_i - F_j|
MFdiv = \frac{\sum_{i=1}^{n}\sum_{j=i+1}^{n}{w_i w_j D_{ij}(\tau)}}{\sum_{i=1}^{n}\sum_{j=i+1}^{n}{w_i w_j}}
5. The final result is the area under the curve (AUC) of MFdiv values across different tau thresholds.
Value
A data frame with MFdiv values for each observation (row) in the input data.
Examples
data(forestfunctions)
head(forestfunctions)
MFdiv(forestfunctions[,6:31], cor = FALSE)
Calculate Multifunctionality Regularity (MFreg)
Description
Calculates the multifunctionality regularity index, which measures how evenly different ecosystem functions are distributed across the system. The function can account for correlations between functions when specified.
Usage
MFreg(data, weights = NULL, cor = FALSE)
Arguments
data |
A data frame or matrix where rows represent observations and columns represent functions. |
weights |
A numeric vector of weights for each function (column in data). If NULL, equal weights are assigned. |
cor |
Logical. If TRUE, function correlations are accounted for using redundancy correction. Default is FALSE. |
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.
When redundancy correction is applied ('cor = TRUE'), the function accounts for correlations between ecosystem functions. The correction process involves:
1. Calculating a distance matrix based on correlations: d_{ij} = \sqrt{1 - |r_{ij}|}
2. Applying threshold-based correction: d_{ij}(\tau) = \min(d_{ij}, \tau)
3. Computing effective function values:
F_i(\tau) = \sum_{j=1}^{L}(1 - \frac{d_{ij}(\tau)}{\tau})f_j
4. Calculating the corrected MFreg using these effective function values:
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)}
5. The final result is the area under the curve (AUC) of MFreg values across different tau thresholds.
Value
A data frame with one column named "MFreg" containing the multifunctionality regularity values for each observation (row) in the input data.
Examples
data(forestfunctions)
head(forestfunctions)
MFreg(forestfunctions[,6:31], cor = FALSE)
Calculate Multifunctionality Richness (MFric)
Description
This function calculates the Multifunctionality Richness (MFric) for each row in a dataset. MFric represents the average level of multiple ecosystem function indicators, reflecting the overall performance of an ecosystem across various functional metrics.
Usage
MFric(data, weights = NULL, cor = FALSE)
Arguments
data |
A numeric data frame or matrix where rows represent observations (e.g., sites, plots) and columns represent different ecosystem functions. |
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. |
cor |
Logical. If FALSE (default), calculates uncorrected MFric. If TRUE, calculates correlation-corrected MFric accounting for redundancy among functions. |
Details
The uncorrected MFric is calculated as:
MFric = \frac{\sum_{i=1}^{n} w_i f_i}{\sum_{i=1}^{n} w_i}
where fi represents the normalized performance level of function i, and wi denotes the weight assigned to function i.
When redundancy correction is applied ('cor = TRUE'), the function accounts for correlations between ecosystem functions. The correction process involves:
1. Calculating a distance matrix based on correlations: d_{ij} = \sqrt{1 - |r_{ij}|}
2. Applying threshold-based correction: d_{ij}(\tau) = \min(d_{ij}, \tau)
3. Computing effective function values:
F_i(\tau) = \sum_{j=1}^{L}(1 - \frac{d_{ij}(\tau)}{\tau})f_j
4. Calculating the corrected MFric using these effective function values:
MFric = \frac{\sum_{i=1}^{n} w_i F_i}{\sum_{i=1}^{n} w_i}
5. The final result is the area under the curve (AUC) of MFric values across different tau thresholds.
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.
Examples
data(forestfunctions)
head(forestfunctions)
MFric(forestfunctions[,6:31], cor = FALSE)
Forest Functions Dataset (forestfunctions)
Description
A dataset containing 26 ecosystem functions measured across the FunDivEUROPE Exploratory Platform. All functions have been preprocessed to handle missing values and normalized to a range of [0,1] within each country, with higher values indicating better ecosystem functionality (except for soil_cn_ff_10 and wue, where lower values are desirable).
Usage
forestfunctions
Format
A data frame with 209 rows and 31 columns:
- plotid
The unique identifier for each forest plot
- target_species_richness
The planned/designed species richness of the plot
- composition
Information about the species composition
- region_centred_ba
Region-centered basal area
- region_centred_coniferous
Region-centered coniferous proportion
- earthworm_biomass.std
Biomass of all earthworms (g m-2)
- fine_woody_debris.std
Snags and standing dead trees shorter than 1.3 m and thinner than 5 cm DBH, and all stumps and other dead wood pieces on the forest floor
- microbial_biomass_mineral.std
Mineral soil (0-5 cm layer) microbial biomass carbon
- soil_c_ff_10.std
Total soil carbon stock (Mg ha-1) in forest floor and 0-10 cm mineral soil layer combined
- litter_decomp_day.std
Decomposition of leaf litter using the litterbag methodology (% daily rate)
- nre.std
Nitrogen resorption efficiency, difference in N content between green and senescent leaves divided by N content of green leaves (%)
- soil_cn_ff_10.std
Soil C/N ratio in forest floor and 0-10 cm mineral soil layer combined (smaller values are desirable)
- wood_decomp_day.std
Decomposition of flat wooden sticks placed on forest floor (% daily rate)
- root_biomass.std
Total biomass of living fine roots in forest floor and 0-10 mineral soil layer combined (g m-2)
- lai.std
Leaf area index
- leaf_litter_production.std
Annual production of foliar litter dry mass (g)
- photo_eff_tot.std
Chlorophyll fluorescence methodology (ChlF)
- tree_growth.std
Annual aboveground wood production (Mg C ha-1 year-1)
- tree_biomass.std
Aboveground biomass of all trees (Mg C ha-1)
- total_understorey_weight.std
Dry weight of all understory vegetation in a quadrant (g)
- sapling_growth.std
Growth of saplings up to 1.60 m tall (cm)
- regeneration_seedlings.std
Number of tree seedlings less than a year old
- regeneration_juveniles.std
Number of saplings up to 1.60 m tall
- wue.std
Resistance to drought, difference in carbon isotope composition in wood cores between dry and wet years (smaller values are desirable)
- resistance_insects.std
Foliage not damaged by insects (%)
- lack_browsing.std
Twigs not damaged by browsers (%)
- no_pathogen_damage.std
Foliage not damaged by pathogens (%)
- tree.growth.recovery.std
Ratio between post-drought growth and growth during the respective drought period
- tree.growth.resilience.std
Ratio between growth after and before the drought period
- tree.growth.resistance.std
Ratio of tree growth during a drought period and growth during the previous 5-year high-growth period
- tree.growth.stability.std
Mean annual tree growth divided by standard deviation in annual tree growth between 1992 and 2011
Details
Missing values (approximately 5% of the data) were imputed using country-level mean values for each function. All functions were then normalized to a range of [0,1] within each country. For most functions, higher values indicate better ecosystem functionality, except for soil_cn_ff_10 and wue, where lower values are desirable.
Source
Scherer-Lorenzen, M., Allan, E., Ampoorter, E., Avacaritiei, D., Baeten, L., Barnoaiea, I. et al. (2023) The functional significance of tree species diversity in European forests—the FunDivEUROPE dataset [dataset]. Dryad Digital Repository. Available from: https://doi.org/10.5061/dryad.9ghx3ffpz
Examples
data(forestfunctions)
head(forestfunctions)