% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/mogen.R
\name{path_counts}
\alias{path_counts}
\title{Count Path Frequencies in Trajectory Data}
\usage{
path_counts(data, k = 2L, top = NULL)
}
\arguments{
\item{data}{A list of character vectors (trajectories) or a data.frame
(rows = trajectories, columns = time points).}

\item{k}{Integer. Length of the path / n-gram (default 2). A k of 2 counts
individual transitions; k of 3 counts two-step paths, etc. Must be a
whole number; a non-integer value is an error rather than being
silently truncated.}

\item{top}{Integer or NULL. If set, returns only the top N most frequent
paths (default NULL = all).}
}
\value{
A data frame with columns: \code{path}, \code{count},
\code{proportion}.
}
\description{
Counts the frequency of k-step paths (k-grams) across all trajectories.
Useful for understanding which sequences dominate the data before applying
formal models.
}
\examples{
trajs <- list(c("A","B","C","D"), c("A","B","D","C"))
path_counts(trajs, k = 2)

\donttest{
path_counts(trajs, k = 3, top = 10)
}

}
