% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/plot_abundance_occupancy.R
\name{plot_abundance_occupancy}
\alias{plot_abundance_occupancy}
\title{Plot Abundance-Occupancy Curve and Display the Core Taxa}
\usage{
plot_abundance_occupancy(core_result, core_set = "elbow")
}
\arguments{
\item{core_result}{A list object returned by \code{\link{identify_core}},
containing at minimum:
\itemize{
\item \code{occupancy_abundance}: A data frame with columns \code{otu},
\code{otu_rel} (mean relative abundance), and \code{otu_occ} (occupancy).
\item \code{elbow_core}: Character vector of OTU IDs identified as core
using the "elbow" method.
\item \code{increase_core}: Character vector of OTU IDs identified as core
using the "increase" method.
}}

\item{core_set}{Character string specifying which core set to highlight.
Must be either "elbow" or "increase" (Default elbow).}
}
\value{
A ggplot object showing the abundance-occupancy plot with core taxa
highlighted in red and non-core taxa in grey. The x-axis shows log10-transformed
mean abundance and the y-axis shows occupancy (0-1).
}
\description{
Creates a scatter plot showing the relationship between mean relative abundance
and occupancy (occurrence frequency) of taxa, with core taxa highlighted.
}
\details{
The function creates a scatter plot where each point represents a
taxon (i.e. ASV or OTU). Core taxa (as defined by the selected method) are
shown in red, while non-core taxa are shown in grey. The plot uses a log10
scale for abundance to better visualize the full range of abundances typically
found in microbiome data.
}
\examples{
library(BRCore)

data("switchgrass_core", package = "BRCore")

p <- plot_abundance_occupancy(
  core_result = switchgrass_core,
  core_set = "increase"
)
print(p)

}
\seealso{
\code{\link[=plot_core_distribution]{plot_core_distribution()}} and \code{\link[=identify_core]{identify_core()}}
}
