Computes functional uniqueness values over a given regional pool. Functional
uniqueness gives the functional distance to the nearest-neighbor of a given
species in the provided distance matrix. See uniqueness()
function for
details on computation. You can either use _stack()
or _tidy()
functions
as they are aliases of one another.
uniqueness_stack(com_df, sp_col, dist_matrix)
uniqueness_tidy(com_df, sp_col, dist_matrix)
a data frame of the species in the regional pool.
a character vector indicating the name of the species column
in the com_df
data frame
a functional distance matrix
A data.frame with uniqueness value per species, with one column with provided species column name and the Ui column with the uniqueness values.
uniqueness()
and vignette("rarity_indices", package = "funrar")
for
details on the uniqueness metric; distinctiveness_stack()
,
restrictedness_stack()
, scarcity_stack()
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)
# Example of trait table
tra = aravo$traits[, c("Height", "SLA", "N_mass")]
# Distance matrix
dist_mat = compute_dist_matrix(tra)
#> Only numeric traits provided, consider using euclidean distance.
ui_df = uniqueness_stack(dat, "species", dist_mat)
head(ui_df)
#> species Ui
#> 1 Agro.rupe 0.03635369
#> 2 Alop.alpi 0.03715692
#> 3 Anth.nipp 0.09414051
#> 4 Heli.sede 0.02270997
#> 5 Aven.vers 0.05675178
#> 6 Care.rosa 0.15922932