% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/sequence_terminal.R
\name{mark_first_state}
\alias{mark_first_state}
\title{Mark leading-NA cells with an explicit state label}
\usage{
mark_first_state(data, state = "Start", cols = NULL)
}
\arguments{
\item{data}{A wide-format matrix or data.frame (rows = actors,
cols = time steps) of state labels with \code{NA} for missing
observations.}

\item{state}{Character. Label to insert in leading-NA cells.
Default \code{"Start"}.}

\item{cols}{Optional state-column names; otherwise all columns.}
}
\value{
A \code{data.frame} of the same shape as \code{data} with leading
NAs filled by \code{state}.
}
\description{
Mirror of \code{\link[=mark_terminal_state]{mark_terminal_state()}} for \emph{left-censored} sequence data.
Replaces every cell \emph{before} each row's first observed state with
the label given by \code{state}. The resulting chain has a structurally
\emph{recurrent} "Start" state that everyone enters from - useful for
cohort-entry analyses where students join at different time points
and you want a uniform pre-observation marker.
}
\details{
Unlike \code{\link[=mark_terminal_state]{mark_terminal_state()}}, the marked state is \strong{not}
absorbing in the resulting transition matrix - every transition
from "Start" goes to one of the original states (the actor's
first observed state), and the "Start" row is row-stochastic
exactly as the data dictates.
}
\examples{
M <- mark_first_state(trajectories, state = "Start")
# In a chain built from M, "Start" is a transient entry point.

}
\seealso{
\code{\link[=mark_terminal_state]{mark_terminal_state()}}, \code{\link[=actor_endpoints]{actor_endpoints()}}
}
