% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/antclassify_community.R
\name{antclassify_community}
\alias{antclassify_community}
\title{Classify Ant Communities Across Multiple Sites}
\usage{
antclassify_community(comm, guild_col = "antclassify_guild", ...)
}
\arguments{
\item{comm}{A community matrix with sites as rows and species as columns.
Species names must match the nomenclature used in the internal databases.}

\item{guild_col}{Character string giving the name of the guild column to use
for aggregation. Must be one of \code{"antclassify_guild"}, \code{"silva_guild"},
\code{"delabie_guild"}, or \code{"silvestre_guild"}. Default is
\code{"antclassify_guild"}.}

\item{...}{Additional arguments passed to \code{\link{assign_guild_ants}} (for
example, \code{validate}, \code{delay}). Note that \code{plot} is always set
to \code{FALSE} inside this function to avoid displaying one plot per site.}
}
\value{
A list with three components:
\item{by_site}{A list of length equal to \code{nrow(comm)}. Each element
contains the full output of \code{\link{assign_guild_ants}} for the
corresponding site.}
\item{guild_abundance}{A matrix of guild abundances (sites × guilds).}
\item{guild_richness}{A numeric vector of length \code{nrow(comm)} giving
the number of distinct guilds found at each site.}
}
\description{
Applies the AntClassify pipeline to each site (row) of a community matrix
and returns aggregated guild abundance and richness matrices.
}
\examples{
# Small community matrix with two sites and six species
comm <- matrix(c(5, 0, 2, 0, 1, 3,
                 2, 4, 0, 2, 0, 0),
               nrow = 2, byrow = TRUE,
               dimnames = list(c("Site1", "Site2"),
                               c("Atta sexdens", "Camponotus atriceps",
                                 "Pheidole megacephala", "Wasmannia auropunctata",
                                 "Solenopsis saevissima", "Nylanderia fulva")))

# Run the classification (validate = FALSE to avoid GBIF calls in examples)
results <- antclassify_community(comm, guild_col = "antclassify_guild",
                                 validate = FALSE)
results$guild_abundance
results$guild_richness
}
