beta_stand: Calculate pairwise/ setwise beta diversities

Description Usage Arguments Details Value Examples

View source: R/setwise_beta.R

Description

This function makes pairwise/ setwise combinations of sites in the community matrix x and calculates pairwise/ setwise beta diversities, respectively. "Set" refers to a user-defined number of samples that will be used. This is essentially the number of plots in a sample-based rarefaction. It's default is 2 (i.e. pairs).

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
beta_stand(
  x,
  setsize = 2,
  func = list("beta_true"),
  args = NULL,
  summarise = T,
  max_combn = 10000,
  resamples = 1000,
  verbose = T
)

Arguments

x

A site by species matrix.

setsize

Number of samples per subset.

func

a list of function names to be used for the metric calculation

args

a list of additional arguments to be passed on to the functions in func

summarise

Return mean and variance of all betas?

max_combn

Number of combinations allowed before resampling is used instead

resamples

Number of samples used if possible combinations exceeds max_combn

verbose

Print notifications?

Details

The calculation of the beta-diversity metric is done according to the function in "func". This should be a function that returns a (dis-)similarity or beta diversity metric for a site-by species matrix like x. "func" is applied to every subset. Additional arguments will be passed on to "func".

If the number of possible sets/ pairwise comparisons exceeds the value of max_combn. A random subsample of all combinations will be drawn. The number of random samples can be adjusted using the argument resamples. It is not recommended to increase the value of max_combn. The function choose() "n over k" can be used to manually compute the number of possible subsets where n is the number of samples/rows in x and k is setsize. If summarise = T, mean and variance of all setwise comparisons are returned. Otherwise, the function returns all individual beta values.

Value

A data frame

Examples

1
2
3
4
5
library(vegan)
data(BCI)
beta_pairwise<-
beta_stand(BCI, func = list( "beta_C"), setsize=2,
args = list(C=0.5))

T-Engel/betaC documentation built on May 2, 2021, 3:19 a.m.