abMat | R Documentation |
Generate a species by site abundance matrix
abMat(x, site_id, species_id, fpc = NULL, abundance = NULL)
x |
dataframe of individual records |
site_id |
column name string of site IDs |
species_id |
column name string of species names |
fpc |
optional column name string of sampling weights of each record, between 0 and 1 |
abundance |
optional column name string with an alternative abundance measure such as biomass, canopy cover, body length |
dataframe of species abundances (columns) per site (rows)
x <- data.frame(site_id = rep(c("A", "B", "C"), each = 3),
species_id = sample(c("a", "b", "c", "d"), 9, replace = TRUE),
fpc = rep(c(0.5, 0.6, 1), each = 3),
abundance = seq(1:9))
abMat(x, "site_id", "species_id")
abMat(x, "site_id", "species_id", "fpc")
abMat(x, "site_id", "species_id", "fpc", "abundance")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.