make_relative {funrar} | R Documentation |
Relative abundance matrix from absolute abundance matrix
Description
From an abundance matrix (numbers of individuals of a given species at a site) returns a relative abundance matrix (proportion of individuals of a given species at a given site). This function works also with sparse matrices.
Usage
make_relative(abund_matrix)
Arguments
abund_matrix |
abundance matrix, with sites in rows and species in columns. |
Value
Similar shaped matrix as the input but with relative abundances instead
Examples
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
[Package funrar version 1.5.0 Index]