% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/sequence-networks.R
\name{create_transition_network}
\alias{create_transition_network}
\title{Create a transition network from ordered sequences}
\usage{
create_transition_network(
  data,
  sequence_id_col = "sequence_id",
  order_col = "sequence_order",
  state_col = "state",
  group_cols = NULL,
  order = 1L,
  include_self = TRUE,
  normalise = c("count", "from", "global"),
  smoothing = 0,
  context_separator = " > "
)
}
\arguments{
\item{data}{Long-format sequence data or a prepared result.}

\item{sequence_id_col, order_col, state_col}{Sequence columns.}

\item{group_cols}{Optional grouping columns constant within sequence.}

\item{order}{Markov order. \code{1} creates ordinary state-to-state edges;
larger values create context-to-next-state edges.}

\item{include_self}{Include first-order self-transitions.}

\item{normalise}{Edge weight scale: counts, conditional probabilities from
each context, or global shares.}

\item{smoothing}{Non-negative additive smoothing applied to observed edges.}

\item{context_separator}{Separator used for higher-order contexts.}
}
\value{
A data frame of class \code{gp3_transition_network} containing context,
next state, counts, weights, sequence prevalence, and group columns.
}
\description{
Create a transition network from ordered sequences
}
\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
)
create_transition_network(sequences, normalise = "from")

}
