% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/markov.R
\name{lag_intervals}
\alias{lag_intervals}
\title{Spatial Lag Intervals Used By A Spatial Markov Object}
\usage{
lag_intervals(x)
}
\arguments{
\item{x}{A \code{grd_spatial_markov} object.}
}
\value{
A tibble of spatial-lag class intervals.
}
\description{
Spatial Lag Intervals Used By A Spatial Markov Object
}
\examples{
\dontshow{if (identical(Sys.getenv("IN_PKGDOWN"), "true")) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf}
panel <- data.frame(
  id = rep(1:4, each = 2),
  year = rep(2020:2021, times = 4),
  value = c(1, 2, 2, 3, 4, 3, 5, 6)
)
grid <- sf::st_sf(
  id = 1:4,
  geometry = sf::st_make_grid(
    sf::st_bbox(c(xmin = 0, ymin = 0, xmax = 2, ymax = 2)),
    n = c(2, 2)
  )
) |>
  dplyr::mutate(
    nb = sfdep::st_contiguity(geometry),
    wt = sfdep::st_weights(nb)
  )
spatial <- spatial_markov(panel, id, year, value, geometry = grid, k = 2)
lag_intervals(spatial)
\dontshow{\}) # examplesIf}
}
