% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/visualization.R
\name{PCplot}
\alias{PCplot}
\title{PCplot:Scatter plot of community compositions colored by basin label}
\usage{
PCplot(ocmat, sa = sa, env = NULL, ssrep = NULL, pruned = TRUE, export = FALSE)
}
\arguments{
\item{ocmat}{Data frame (or matrix) of community compositions (rows = samples,
columns = species/features).}

\item{sa}{Parameter set passed to \link{sa2params}.}

\item{env}{Optional environment object passed to \link{sa2params}.}

\item{ssrep}{Data frame-like object providing stable state label mapping with
two columns: \code{stablestates} and \code{stablestates2}.}

\item{pruned}{Logical; if TRUE, use \code{stablestates2} for coloring.}

\item{export}{Logical; if TRUE, return the data used for plotting.}
}
\value{
NULL invisibly (or a data frame when \code{export = TRUE}).
}
\description{
Performs PCA on the community composition matrix (\code{ocmat}) and plots the first
two PCs. Points are colored by the stable state (basin) label estimated
from \link{Bi}. If \code{pruned = TRUE}, colors correspond to the
pruned/merged basin labels in \code{ssrep} (\code{stablestates2}), otherwise to the
original labels (\code{stablestates}). When \code{export = TRUE}, the plotting data
frame (stable-state labels + PCs + merged labels) is returned.
}
