% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/classify.R
\name{classify_dynamics}
\alias{classify_dynamics}
\title{Classify Longitudinal Values For Distribution Dynamics}
\usage{
classify_dynamics(
  data,
  id,
  time,
  value,
  method = c("pooled_quantile", "time_quantile", "fixed", "existing"),
  k = 5,
  breaks = NULL,
  labels = NULL
)
}
\arguments{
\item{data}{A data frame or \code{sf} object in long format.}

\item{id, time, value}{Columns identifying spatial unit, time, and value.}

\item{method}{Classification method. \code{"pooled_quantile"} uses one set of
quantile breaks across all periods. \code{"time_quantile"} uses period-specific
ranks. \code{"fixed"} uses user-supplied \code{breaks}. \code{"existing"} treats \code{value}
as an already classified state.}

\item{k}{Number of quantile classes.}

\item{breaks}{Breaks for \code{method = "fixed"}.}

\item{labels}{Optional class labels.}
}
\value{
A data frame or \code{sf} object with a \code{class} column and class
\code{grd_classes}.
}
\description{
Converts numeric values in a long panel into ordered classes suitable for
transition analysis.
}
\examples{
\dontshow{if (identical(Sys.getenv("IN_PKGDOWN"), "true")) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf}
panel <- data.frame(
  id = rep(letters[1:4], each = 3),
  year = rep(2020:2022, times = 4),
  value = c(8, 9, 11, 10, 12, 13, 15, 14, 16, 20, 22, 25)
)

classes <- classify_dynamics(panel, id, year, value, k = 3)
classes
class_intervals(classes)
\dontshow{\}) # examplesIf}
}
