% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/plot_core_distribution.R
\name{plot_core_distribution}
\alias{plot_core_distribution}
\title{Plot Core Taxa  Occupancy Across Metadata Groups}
\usage{
plot_core_distribution(
  core_result,
  core_set = "elbow",
  group_var = "Crop",
  plot_type = c("bar", "line", "heatmap")
)
}
\arguments{
\item{core_result}{A list object returned by \code{\link{identify_core}},
containing at minimum:
\itemize{
\item \code{otu_table}: A data frame with ASV/OTUs as rows and samples
as columns.
\item \code{metadata}: A data frame with samples as rows and grouping
variables as columns.
\item \code{otu_ranked}: A data frame with ranked taxa containing:
\itemize{
\item \code{otu}: A column with taxa names.
\item \code{rank}: A column with the rank for each taxon.
}
\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}{Which core set to plot: "elbow" (default) or "increase".}

\item{group_var}{Metadata column for bar coloring. Default: "sampling_date".}

\item{plot_type}{Allows selection of 3 different plot types: \code{bar}, \code{line}, or \code{heatmap}.}
}
\value{
A ggplot2 object that can be further customized.
}
\description{
Creates a plot showing core taxa (i.e. OTUs/ASVs) occupancy patterns across
a grouping variable.
}
\examples{
library(BRCore)
data("switchgrass_core", package = "BRCore")

p <- plot_core_distribution(
  core_result = switchgrass_core,
  core_set = "increase",
  group_var = "sampling_date",
  plot_type = "bar"
)
print(p)

}
\seealso{
\code{\link[=identify_core]{identify_core()}}, \code{\link[=plot_abundance_occupancy]{plot_abundance_occupancy()}}, and
\code{\link[=plot_identified_core]{plot_identified_core()}}
}
