Isr {Rarity} | R Documentation |
Index of Summed Rarity
Description
Calculates the Index of Relative Rarity for a single or a set of assemblages of species. The index of summed rarity consists in summing the rarity weights of species in the assemblage, with the possibility of normalising between 0 (the assemblage has only minimum-weight species) and 1 (value of the complete pool of species (see details)).
Usage
Isr(assemblages, W, abundance = FALSE, Wmin = min(W), normalise = FALSE)
Arguments
assemblages |
|
W |
|
abundance |
logical. If |
Wmin |
decimal or |
normalise |
logical. If |
Details
assemblages
can contain a single (vector) or several (matrix or data.frame) assemblages. If assemblages
is a vector, values must be named with species names (e.g. with names(assemblages) <- sp.names
). If assemblages
is a matrix or a data.frame, then rows must be named with species names.
All the species of assemblages
must be contained in W
W
can contain a single vector of rarity weights, or a matrix or a data.frame of rarity weights (e.g. to calculate different Indices of Summed Rarity for different scales). If W
is a vector, values must be named with species names. If W
is a matrix or a data.frame, then species are in rows and each column contains rarity weights. Rows must be named with species names.
If the input of rWeights
is directly entered, then columns Q
(occurrence), R
(rarity status) and cut.off
(rarity cut-off points) will be dropped.
Formula implemented in this function:
Occurrence-based Isr, not normalised between 0 and 1:
\sum w_i
where wi is the weight of the ith species in the assemblage
Abundance-based Isr, not normalised between 0 and 1:
\sum a_i \times w_i
where ai and wi are respectively the abundance and weight of the ith species in the assemblage
Occurrence-based Isr, normalised between 0 and 1:
\frac{\sum(w_i - w_{min})}{\sum(W_j - w_{min})}
where wi is the weight of the ith species in the assemblage, wmin the minimum weight and Wj the weight of the jth species in the total species pool (provided in
W
).
Species with NA
weights are excluded when indices are computed (they are kept for richness).
Value
A data.frame containing the Indices of Relative Rarity and the species richness of the assemblage(s).
Warning
Column names of W
with names like "Q", "R", "cut.off", "Q1" "Q2" "Q3" and so on, "R1", "R2" "R3" and so on, "cut.off1", "cut.off2", and so on will be ignored.
Author(s)
Boris Leroy leroy.boris@gmail.com
References
Leroy B., Petillon J., Gallon R., Canard A., & Ysnel F. (2012) Improving occurrence-based rarity metrics in conservation studies by including multiple rarity cut-off points. Insect Conservation and Diversity, 5, 159-168.
Leroy B., Canard A., & Ysnel F. 2013. Integrating multiple scales in rarity assessments of invertebrate taxa. Diversity and Distributions, 19, 794-803.
See Also
Examples
# Input rarity weights
data(spid.occ)
# Example of a single scale dataset
regional.occ <- spid.occ$occurMA
names(regional.occ) <- rownames(spid.occ)
head(regional.occ)
# Preparation of rarity weights
rarity.weights <- rWeights(regional.occ)
# Generation of an assemblage matrix
assemblages.matrix <- cbind(assemblage.1 = sample(c(0, 1), 50, replace = TRUE),
assemblage.2 = sample(c(0, 1), 50, replace = TRUE),
assemblage.3 = sample(c(0, 1), 50, replace = TRUE),
assemblage.4 = sample(c(0, 1), 50, replace = TRUE),
assemblage.5 = sample(c(0, 1), 50, replace = TRUE))
# Random attribution of names to the sampled species
rownames(assemblages.matrix) <- sample(names(regional.occ), 50, replace = FALSE)
head(assemblages.matrix)
# Calculation of Isr
Isr(assemblages.matrix, rarity.weights)
Isr(assemblages.matrix, rarity.weights, normalise = TRUE)
# Example of a multi scale dataset
rarity.weights <- rWeights(spid.occ, extended = TRUE)
head(rarity.weights)
# Generation of an assemblage matrix
assemblages.matrix <- cbind(assemblage.1 = sample(c(0, 1), 50, replace = TRUE),
assemblage.2 = sample(c(0, 1), 50, replace = TRUE),
assemblage.3 = sample(c(0, 1), 50, replace = TRUE),
assemblage.4 = sample(c(0, 1), 50, replace = TRUE),
assemblage.5 = sample(c(0, 1), 50, replace = TRUE))
rownames(assemblages.matrix) <- sample(names(regional.occ), 50, replace = FALSE)
head(assemblages.matrix)
# Calculation of Isr
Isr(assemblages.matrix, rarity.weights)
Isr(assemblages.matrix, rarity.weights, normalise = TRUE)