scarcity_com | R Documentation |
Given a stacked data.frame compute species scarcity. Scarcity measures how
abundant is a species locally. 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.
scarcity_com(com_df, sp_col, 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 |
abund |
a character vector, the name of the column containing relative abundances values |
the same data.frame with the additional Si column giving scarcity values for each species
This function is meant for internal uses mostly, thus it does not include any
tests on inputs and may fail unexpectedly. Please use scarcity_stack()
to
avoid input errors.
scarcity()
and vignette("rarity_indices", package = "funrar")
for details on the scarcity metric; distinctiveness_com()
to compute
distinctiveness on a single community
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_com(subset(dat, site == "AR07"), "species", "value")
head(si_df)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.