restrictedness_stack {funrar} | R Documentation |
Geographical Restrictedness for stacked data.frame
Description
Compute the geographical restrictedness for each species present in the
stacked data.frame. Geographical restrictedness is an index related to the
extent of a species in a given dataset, it is close to 1 when the species is
present in only a single site of the dataset (restricted) and close to 0 when
the species is present at all sites. It estimates the geographical extent of
a species in a dataset. See restrictedness()
for details
on restrictedness computation. You can either use _stack()
or _tidy()
functions as they are aliases of one another.
Usage
restrictedness_stack(com_df, sp_col, com, relative = FALSE)
restrictedness_tidy(com_df, sp_col, com, relative = FALSE)
Arguments
com_df |
a stacked (= tidy) data.frame of communities |
sp_col |
a character vector indicating the name of the species column |
com |
a character vector indicating the name of the community column |
relative |
a logical (default = FALSE), indicating if restrictedness should be computed relative to restrictedness from a species occupying a single site |
Value
A stacked data.frame containing species' names and their
restrictedness value in the Ri column, similar to what
uniqueness_stack()
returns.
See Also
restrictedness()
, uniqueness_stack()
Examples
data("aravo", package = "ade4")
# Site-species matrix converted into data.frame
mat = as.matrix(aravo$spe)
dat = matrix_to_stack(mat, "value", "site", "species")
dat$site = as.character(dat$site)
dat$species = as.character(dat$species)
ri_df = restrictedness_stack(dat, "species", "site")
head(ri_df)