Learn R Programming

zetadiv (version 1.2.1)

Zeta.sam.sensitivity: Sensitivity analysis for the sample size of zeta

Description

Computes zeta diversity for a given order (number of assemblages or sites) for a range of sample sizes, to assess the sensitivity to this parameter.

Usage

Zeta.sam.sensitivity(
  data.spec,
  xy = NULL,
  order = 1,
  sam.seq,
  reps = 20,
  sd.correct = TRUE,
  sd.correct.adapt = FALSE,
  rescale = FALSE,
  normalize = FALSE,
  NON = FALSE,
  FPO = NULL,
  DIR = FALSE,
  display = TRUE,
  plot = TRUE,
  notch = TRUE
)

Arguments

data.spec

Site-by-species presence-absence data frame, with sites as rows and species as columns.

xy

Site coordinates. This is only used if NON = TRUE or DIR = TRUE.

order

Specific number of assemblages or sites at which zeta diversity is computed.

sam.seq

Sequence of samples for which the zeta diversity is computed.

reps

Number of replicates of zeta diversity computations for each sample size.

sd.correct

Boolean value (TRUE or FALSE) indicating if the standard deviation must be computed with an unbiased estimator (using the number of site combinations - 1 as the denominator) or not (using the number of site combinations as the denominator).

sd.correct.adapt

Boolean value (TRUE or FALSE) indicating if the standard deviation must be computed with an unbiased estimator (using the number of site combinations - 1 as the denominator) if sam is higher than the number of possible combinations, or not (using the number of site combinations as the denominator) if sam is lower than the number of possible combinations. If sd.correct.adapt == TRUE, it takes precedence over sd.correct.

rescale

Boolean value (TRUE or FALSE) indicating if the zeta values should be divided by \(\zeta_1\), to get a range of values between 0 and 1.

normalize

Indicates if the zeta values for each sample should be divided by the total number of species for this specific sample (normalize = "Jaccard"), by the average number of species per site for this specific sample (normalize = "Sorensen"), or by the minimum number of species in the sites of this specific sample (normalize = "Simpson"). Default value is FALSE, indicating that no normalization is performed.

NON

Boolean value (TRUE or FALSE) indicating if the number of species in common should only be counted for the nearest neighbours.

FPO

A vector with the coordinates of the fixed point origin from which the zeta diversity will be computed (overrides NON). In that case, \(\zeta_1\) is the number of species in the closest site to the FPO, \(\zeta_2\) is the number of species shared by the 2 closest sites, etc.

DIR

Boolean value (TRUE or FALSE) indicating if zeta diversity must be computed using a directed nearest neighbour scheme in the direction away from the FPO, starting from any site.

display

Boolean value (TRUE or FALSE) indicating if the current value of the sample size must be displayed. Acts as a counter.

plot

Boolean value (TRUE or FALSE) indicating if the outputs must be plotted as a boxplot of the zeta diversity distributions for each sample size

notch

Boolean value (TRUE or FALSE) indicating if the notches must be plotted in the boxplot.

Value

Zeta.sam.sensitivity returns a matrix with (sam.max-sam.min)/sam.incr columns and reps rows.

Details

Note that the execution of Zeta.sam.sensitivity can be quite lengthy, because of the number of replicates needed.

References

Hui C. & McGeoch M.A. (2014). Zeta diversity as a concept and metric that unifies incidence-based biodiversity patterns. The American Naturalist, 184, 684-694.

See Also

Zeta.decline.mc, Zeta.order.mc, Zeta.decline.ex, Zeta.order.ex

Examples

Run this code
# NOT RUN {
#Note that the sensitivity analyses in the following two examples are quite long to run,
#typically around 10 minutes for the first example and 1-2 minutes for the second.

utils::data(bird.spec.coarse)
xy.bird <- bird.spec.coarse[1:2]
data.spec.bird <- bird.spec.coarse[3:193]

dev.new()
zeta.sens.bird <- Zeta.sam.sensitivity(data.spec.bird, order = 3,
    sam.seq = seq(250,1000,250), reps = 20, display = TRUE, plot = TRUE, notch = TRUE)
zeta.sens.bird

##########

utils::data(Marion.species)
xy.marion <- Marion.species[1:2]
data.spec.marion <- Marion.species[3:33]

dev.new()
zeta.sens.marion <- Zeta.sam.sensitivity(data.spec.marion, order = 3,
    sam.seq = seq(50,250,50), reps = 20, plot = TRUE, notch = TRUE)
zeta.sens.marion
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab