% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/markov.R
\name{markov_dynamics}
\alias{markov_dynamics}
\title{Estimate Classic Markov Transition Dynamics}
\usage{
markov_dynamics(classes, id, time, state = class)
}
\arguments{
\item{classes}{A classified data frame from \code{\link[=classify_dynamics]{classify_dynamics()}} or any data
frame with ID, time, and state columns.}

\item{id, time, state}{Columns identifying spatial unit, time, and state.}
}
\value{
A \code{grd_markov} object.
}
\description{
Estimates transition counts and probabilities between adjacent periods for a
classified long panel.
}
\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)
markov <- markov_dynamics(classes, id, year, class)

markov
transition_matrix(markov)
steady_state(markov)
\dontshow{\}) # examplesIf}
}
