Learn R Programming

zetadiv (version 1.2.0)

Zeta.ddecays: Zeta distance decay for a range of numbers of assemblages or sites

Description

Computes the distance decay of zeta diversity for a range of orders (number of assemblages or sites), using generalised linear models.

Usage

Zeta.ddecays(
  xy,
  data.spec,
  orders = 2:10,
  sam = 1000,
  family = stats::gaussian(),
  distance.type = "Euclidean",
  dist.custom = NULL,
  method = "mean",
  confint.level = 0.95,
  trsf = "NULL",
  cutoff = NULL,
  rescale = FALSE,
  normalize = FALSE,
  plot = TRUE
)

Arguments

xy

Site-by-coordinate data frame, with sites as rows and coordinates as columns.

data.spec

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

orders

Range of number of assemblages or sites at which zeta diversity is computed. All the orders must be striclty greater than 1.

sam

Number of samples for which the zeta diversity is computed.

family

A description of the error distribution and link function to be used in the generalised linear models (see family for details of family functions).

distance.type

Method to compute distance. Default is "Euclidean", for Euclidean distance. The other options are (i) "ortho" for orthodromic distance, if xy correspond to longitudes and latitudes (orthodromic distance is computed using the gdist function from package Imap); and (ii) "custom", in which case the user must provide a distance matrix for dist.custom.

dist.custom

Distance matrix provided by the user when distance.type = "custom".

method

Name of a function (as a string) indicating how to combine the pairwise differences and distances for more than 3 sites. It can be a basic R-function such as "mean" or "max", but also a custom function.

confint.level

Percentage for the confidence intervals of the coefficients from the linear regression.

trsf

Name of a function (as a string) indicating how to transform distance. Default is "NULL" for the identity transformation.

cutoff

If specified, maximum distance value for which the linear regression must be performed.

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. Has no effect if normalize != FALSE.

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.

plot

Boolean value (TRUE or FALSE) indicating if the outputs must be plotted.

Value

Zeta.ddecays returns a list containing the following components:

orders

Range of number of assemblages or sites at which zeta diversity was computed.

coefs

A vector of the coefficients from the generalised linear models for the numbers of sites specified by orders.

confint

The confidence intervals for the coefficients from the generalised linear models.

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, Zeta.ddecay

Examples

Run this code
# NOT RUN {
utils::data(bird.spec.coarse)
xy.bird <- bird.spec.coarse[,1:2]
data.spec.bird <- bird.spec.coarse[,3:193]

dev.new()
zeta.ddecays.bird <- Zeta.ddecays(xy.bird, data.spec.bird, sam = 100, orders = 2:5,
    plot = TRUE, confint.level = 0.95)

##########

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

dev.new()
zeta.ddecays.marion <- Zeta.ddecays(xy.marion, data.spec.marion, sam = 100,
   orders = 2:5, plot = TRUE, confint.level = 0.95)

# }

Run the code above in your browser using DataLab