View source: R/make_relative.R
is_relative | R Documentation |
From an abundance/presence-absence matrix or data.frame tells if it contains relative abundances or absolute abundances. Checks if all abundances are between 1 and 0 but never checks sum of abundances per community.
is_relative(given_obj, abund = NULL)
given_obj |
abundance or presence-absence matrix, with sites in rows and species in columns, or tidy community data frame |
abund |
name of the column of the provided object that contains the abundances |
TRUE
if the input has relative abundances FALSE
otherwise
make_relative()
to transform matrix into a relative abundance
matrix.
data("aravo", package = "ade4")
# Site-species matrix
mat = as.matrix(aravo$spe)
head(mat)[, 1:5] # Has absolute abundances
rel_mat = make_relative(mat)
head(rel_mat) # Relative abundances
# Forced to use ':::' becasue function is not exported
funrar:::is_relative(mat) # FALSE
funrar:::is_relative(rel_mat) # TRUE
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.