check_rarity_atlantic_ants: Identify Ant Rarity Forms (Atlantic Forest)

View source: R/check_rarity_atlantic_ants.R

check_rarity_atlantic_antsR Documentation

Identify Ant Rarity Forms (Atlantic Forest)

Description

Checks a community matrix for ant rarity forms in the Brazilian Atlantic Forest based on Silva et al. (2024).

Usage

check_rarity_atlantic_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 the plot of rarity forms distribution.

Value

Invisibly returns a list with two elements:

table

A data frame containing rare species detected, with columns species, rarity_form, abundance, and percentage.

plot

A ggplot2 object showing the distribution of rarity forms.

Examples

# Create a small example community matrix
species_list <- c(
  "Ectatomma brunneum", "Pheidole aberrans", "Camponotus crassus",
  "Solenopsis saevissima", "Pachycondyla striata"
)
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 <- check_rarity_atlantic_ants(comm_data, verbose = FALSE, plot = FALSE)
head(result$table)

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