% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/ild_spacing.R
\name{ild_spacing}
\alias{ild_spacing}
\title{Spacing diagnostics and correlation-structure recommendation}
\usage{
ild_spacing(x, gap_large_hours = 12)
}
\arguments{
\item{x}{An ILD object (see [is_ild()]).}

\item{gap_large_hours}{Numeric. Intervals (in hours) above which to count
as "large gaps" for \code{large_gaps_pct} (default 12). Ignored if time
is not in seconds (e.g. numeric day indices).}
}
\value{
A list with \code{median_interval} (hours), \code{iqr} (hours),
  \code{large_gaps_pct} (percent of intervals \code{> gap_large_hours}),
  \code{coefficient_of_variation}, \code{recommendation} (character: use CAR1 or AR1),
  and \code{spacing_class} (\code{regular-ish} or \code{irregular-ish}).
}
\description{
Reports observation intervals in human-friendly units (e.g. hours) and
recommends AR1 vs CAR1 for use in [ild_lme()]. Surfaces the same logic
that \code{ild_lme(..., ar1 = TRUE)} uses internally so users can see
why a correlation structure was chosen.
}
\examples{
d <- ild_simulate(n_id = 5, n_obs_per = 10, irregular = TRUE, seed = 1)
x <- ild_prepare(d, id = "id", time = "time", gap_threshold = 7200)
ild_spacing(x)
}
