% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/plot_state_frequencies.R
\name{state_distribution}
\alias{state_distribution}
\alias{state_distribution.netobject}
\alias{state_distribution.htna}
\alias{state_distribution.mcml}
\alias{state_distribution.netobject_group}
\alias{state_distribution.default}
\title{Per-Class State Distribution as a Tidy Data Frame}
\usage{
state_distribution(x, ...)

\method{state_distribution}{netobject}(x, ...)

\method{state_distribution}{htna}(x, ...)

\method{state_distribution}{mcml}(x, include_macro = FALSE, ...)

\method{state_distribution}{netobject_group}(x, ...)

\method{state_distribution}{default}(x, ...)
}
\arguments{
\item{x}{A \code{netobject}, \code{netobject_group}, \code{mcml}, or
\code{htna} object.}

\item{...}{Currently unused.}

\item{include_macro}{For \code{mcml}: when \code{TRUE}, prepend a
\code{group = "macro"} block aggregating across clusters. Ignored for
the other classes.}
}
\value{
A \code{data.frame} with columns \code{group} (character),
\code{state} (character), \code{count} (integer), and
\code{proportion} (numeric, within-group share).
}
\description{
Returns a tidy \code{data.frame(group, state, count, proportion)} with one
row per (group, state) cell. Companion to \code{\link{state_frequencies}}
(which counts unique states in raw sequence input);
\code{state_distribution()} pulls the same shape of frame from a fitted
Nestimate object so analyses don't have to reach for the underlying
\code{$data} slot directly.
}
\details{
Used internally by \code{\link{plot_state_frequencies}} as the data layer
behind every chart, and surfaced as the \code{$table} slot of the
returned \code{state_freq} object.
}
\examples{
\dontrun{
  data(ai_long)
  net <- build_network(ai_long, method = "frequency",
                       id_col = "session_id",
                       time_col = "order_in_session", action = "code")
  state_distribution(net)
}
}
