% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/sequence-networks.R
\name{detect_transition_communities}
\alias{detect_transition_communities}
\title{Detect descriptive transition communities}
\usage{
detect_transition_communities(
  network,
  method = c("label_propagation", "components"),
  max_iter = 100L,
  seed = 1L
)
}
\arguments{
\item{network}{A first-order transition network.}

\item{method}{\code{"label_propagation"} or \code{"components"}.}

\item{max_iter}{Maximum label-propagation iterations.}

\item{seed}{Reproducibility seed used only to rotate update order.}
}
\value{
A data frame with states and deterministic community labels.
}
\description{
Detect descriptive transition communities
}
\examples{
sequences <- data.frame(
  sequence_id = rep(c("s1", "s2", "s3", "s4"), each = 4L),
  sequence_order = rep(1:4, times = 4L),
  state = c("A", "B", "C", "D", "A", "B", "C", "C",
            "D", "C", "B", "A", "D", "C", "A", "A"),
  group = rep(c("g1", "g2"), each = 8L),
  stringsAsFactors = FALSE
)
network <- create_transition_network(sequences)
detect_transition_communities(network)

}
