assign_guild_ants: Assign Functional Guilds for Ants

View source: R/assign_guild_ants.R

assign_guild_antsR Documentation

Assign Functional Guilds for Ants

Description

Classifies ants into functional guilds using four different ecological databases.

Usage

assign_guild_ants(comm, verbose = TRUE, plot = TRUE)

Arguments

comm

A community matrix where species are columns and samples are rows.

verbose

Logical; if TRUE, displays progress messages.

plot

Logical; if TRUE, displays guild proportion plots.

Value

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.

Examples


# 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)


AntClassify documentation built on April 9, 2026, 9:08 a.m.