R/as-hts-inla.R

Defines functions as_hts_inla

Documented in as_hts_inla

#' @title Create object of class "hts_inla"
#'
#' @param x model from inlabru
#' @param formula formula passed to `fit_hts()`
#'
#' @return hts_inla model
#' @author Nicholas Tierney
#' @note internal
as_hts_inla <- function(x, formula) {
  class(x) <- c("hts_inla", "bru", "iinla", "inla")
  x$hts_response <- rlang::f_lhs(formula)
  x$hts_terms <- extract_hts(formula)
  x$formula <- formula
  x
}
njtierney/yahtsee documentation built on Feb. 5, 2022, 8:25 p.m.