R/tibble-type_sum.R

Defines functions type_sum.ts_split_indicies type_sum.recursive_panel type_sum.recursive type_sum.mdl_time_tbl

Documented in type_sum.mdl_time_tbl

#' Succinct summary of Modeltime Tables
#'
#' `type_sum` controls how objects are shown when inside tibble
#'  columns.
#' @param x	A `mdl_time_tbl` object to summarise.
#' @return A character value.
#' @importFrom tibble type_sum
#' @keywords internal
#' @export
type_sum.mdl_time_tbl <- function(x) {
    stringr::str_glue("model_time")
}

#' @importFrom tibble type_sum
#' @export
type_sum.recursive <- function(x) {
    class(x) <- class(x)[stringr::str_detect(class(x), "recursive", negate = TRUE)]
    type_sum(x)
}

#' @importFrom tibble type_sum
#' @export
type_sum.recursive_panel <- function(x) {
    class(x) <- class(x)[stringr::str_detect(class(x), "recursive", negate = TRUE)]
    type_sum(x)
}

#' @importFrom tibble type_sum
#' @export
type_sum.ts_split_indicies <- function(x) {

    stringr::str_glue("split [{length(x$idx_train)}|{length(x$idx_test)}]")
}

Try the modeltime package in your browser

Any scripts or data that you put into this service are public.

modeltime documentation built on Oct. 23, 2024, 1:07 a.m.