Skip to contents

Calculate the niche overlap between all combinations of taxa as present in the 'taxa' argument, or the combinations of taxa present in the 'taxa' and 'taxa_comp' arguments. Two methods are curently provided: "D" - Schoener's D (Schoener, 1968) "I" - Warren's I (Warren et al., 2008)

Usage

calc_overlap(
  taxa,
  taxa_comp = NULL,
  data = elements::HOAData,
  vars = elements::VariableNames,
  method = "D",
  average = FALSE,
  format = "wide"
)

Arguments

taxa

A vector of strings containing taxon codes, see elements::ModelledTaxaCodes.

taxa_comp

A vector of string containing taxon codes, see elements::ModelledTaxaCodes.

data

A data frame containing the univariate responses of the taxa supplied in the 'taxa' and 'taxa_comp' arguments for the variables supplied in the 'vars' argument. elements::HOAData by default.

vars

A vector of strings containing the variables for which to calculate the overlap, one or more of elements::VariableNames.

method

A string, one of "D" or "I" indicating the overlap method (see description).

average

A boolean (TRUE/FALSE) indicating whether to calculate the mean overlap across all variables.

format

A boolean (TRUE/FALSE) indicating whether to return the results in wide of long format.

Value

A data frame containing the overlap values.

References

Schoener, T.W., 1968. The Anolis Lizards of Bimini: Resource Partitioning in a Complex Fauna. Ecology 49, 704–726. https://doi.org/10.2307/1935534 Warren, D.L., Glor, R.E., Turelli, M., 2008. ENVIRONMENTAL NICHE EQUIVALENCY VERSUS CONSERVATISM: QUANTITATIVE APPROACHES TO NICHE EVOLUTION. Evolution 62, 2868–2883. https://doi.org/10.1111/j.1558-5646.2008.00482.x

Examples

elements::calc_overlap(taxa = c("carex_arenaria", "carex_divulsa", "carex_hirta", "carex_sylvatica"))
#>     taxon_code_1    taxon_code_2        GP         L         M         N
#> 1 carex_arenaria   carex_divulsa 0.5031094 0.5402679 0.5681454 0.5734668
#> 2 carex_arenaria     carex_hirta 0.8185350 0.6410148 0.6815202 0.6983207
#> 3 carex_arenaria carex_sylvatica 0.5638163 0.4227360 0.5603619 0.5551791
#> 4  carex_divulsa     carex_hirta 0.6008920 0.7384367 0.5164395 0.7911835
#> 5  carex_divulsa carex_sylvatica 0.8477718 0.2251651 0.4554916 0.7987596
#> 6    carex_hirta carex_sylvatica 0.6389779 0.3144370 0.7831350 0.8347743
#>     prec_sm   prec_wt         R         S        SD   tmax_sm   tmin_wt
#> 1 0.6760245 0.6781436 0.3934124 0.4617990 0.6277570 0.3461276 0.4650646
#> 2 0.4944303 0.6551107 0.6013968 0.5287972 0.6876318 0.6669901 0.7775983
#> 3 0.3866701 0.7497361 0.5331587 0.5019139 0.7325371 0.6321778 0.7302398
#> 4 0.5196927 0.5048234 0.6258151 0.7188923 0.6190086 0.5470688 0.5017872
#> 5 0.4350060 0.6057045 0.6838383 0.9088337 0.8248326 0.5153713 0.4652367
#> 6 0.7947072 0.7531000 0.9024395 0.7778183 0.6280408 0.8064970 0.8504291