View source: R/assign_guild_ants.R
| assign_guild_ants | R Documentation |
Classifies ants into functional guilds using four different ecological databases.
assign_guild_ants(comm, verbose = TRUE, plot = TRUE)
comm |
A community matrix where species are columns and samples are rows. |
verbose |
Logical; if |
plot |
Logical; if |
Invisibly returns a list with two elements:
table |
A data frame containing species, abundance, percentage, and guild assignments from each system (AntClassify, Silva, Delabie, Silvestre). |
plots |
A list of four ggplot2 objects, one for each guild classification system. |
# Create a small example community matrix
species_list <- c(
"Pachycondyla striata", "Pheidole gertrudae", "Solenopsis saevissima",
"Strumigenys denticulata", "Wasmannia auropunctata", "Nylanderia fulva",
"Odontomachus affinis", "Hypoponera foreli", "Hypoponera sp",
"Ectatomma edentatum", "Acanthognathus rudis", "Acromyrmex subterraneus"
)
set.seed(123)
comm_data <- matrix(
rpois(length(species_list) * 3, lambda = 2),
nrow = 3,
ncol = length(species_list),
dimnames = list(paste0("sample", 1:3), species_list)
)
result <- assign_guild_ants(comm_data, verbose = FALSE, plot = FALSE)
head(result$table)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.