R/restrictedness.R
restrictedness_stack.Rd
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.
restrictedness_stack(com_df, sp_col, com, relative = FALSE)
restrictedness_tidy(com_df, sp_col, com, relative = FALSE)
a stacked (= tidy) data.frame of communities
a character vector indicating the name of the species column
a character vector indicating the name of the community column
a logical (default = FALSE), indicating if restrictedness should be computed relative to restrictedness from a species occupying a single site
A stacked data.frame containing species' names and their
restrictedness value in the Ri column, similar to what
uniqueness_stack()
returns.
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)
#> species Ri
#> 1 Agro.rupe 0
#> 2 Alch.glau 0
#> 3 Alch.pent 0
#> 4 Alch.vulg 0
#> 5 Alop.alpi 0
#> 6 Andr.brig 0