View source: R/check_endemic_atlantic_ants.R
| check_endemic_atlantic_ants | R Documentation |
Checks a community matrix for ant species endemic to the Brazilian Atlantic Forest based on Silva et al. (2025).
check_endemic_atlantic_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 endemic species detected, with columns species, abundance, and percentage. |
plot |
A ggplot2 object showing the proportion of endemic vs. other species. |
# Create a small example community matrix
species_list <- c(
"Camponotus fallatus", "Solenopsis saevissima", "Hypoponera leninei",
"Pachycondyla striata", "Pheidole megacephala"
)
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_endemic_atlantic_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.