% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/ild_tsibble.R
\name{ild_as_tsibble}
\alias{ild_as_tsibble}
\title{Convert an ILD object to a tsibble}
\usage{
ild_as_tsibble(x, ...)
}
\arguments{
\item{x}{An object that passes [validate_ild()].}

\item{...}{Optional arguments passed to [tsibble::as_tsibble()] (e.g.
override \code{regular}).}
}
\value{
A \code{tbl_ts} object (see \pkg{tsibble}).
}
\description{
Wraps [tsibble::as_tsibble()] using the subject and time column names from
[ild_meta()] as key and index. When [ild_prepare()] recorded tsibble
provenance (\code{ild_tsibble_meta()} is non-\code{NULL}), the \code{regular}
argument is set from the stored \code{is_regular} flag so the reconstructed
\code{interval} often matches the original for unchanged data. Otherwise
defaults to \code{regular = TRUE}.
}
\examples{
\donttest{
d <- ild_simulate(n_id = 4, n_obs_per = 5, seed = 1)
x <- ild_prepare(d, id = "id", time = "time")
if (requireNamespace("tsibble", quietly = TRUE)) {
  ts <- ild_as_tsibble(x)
  class(ts)
}
}
}
\seealso{
\href{../doc/tsibble-interoperability.html}{\code{vignette("tsibble-interoperability", package = "tidyILD")}}
}
