scarcity_stack | R Documentation |
Compute scarcity values for several communities. Scarcity computation
requires relative abundances. Scarcity is close to 1 when a species is rare
in a community and close to 0 when it is abundant. See scarcity()
function
or the functional rarity indices vignette included in the package (type
vignette("rarity_indices", package = "funrar")
) for details about the
index. You can either use _stack()
or _tidy()
functions as they are
aliases of one another.
scarcity_stack(com_df, sp_col, com, abund) scarcity_tidy(com_df, sp_col, com, abund)
com_df |
a stacked (= tidy) data.frame from a single community with each row representing a species in a community |
sp_col |
a character vector, the name of the species column in |
com |
a character vector indicating the column name of communities ID in
|
abund |
a character vector, the name of the column containing relative abundances values |
The same table as com_df
with an added S_i column
for Scarcity values.
scarcity()
and vignette("rarity_indices", package = "funrar")
for details on the scarcity metric; distinctiveness_stack()
,
restrictedness_stack()
, uniqueness_stack()
data("aravo", package = "ade4") # Site-species matrix converted into data.frame mat = as.matrix(aravo$spe) mat = make_relative(mat) dat = matrix_to_stack(mat, "value", "site", "species") dat$site = as.character(dat$site) dat$species = as.character(dat$species) si_df = scarcity_stack(dat, "species", "site", "value") head(si_df)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.