From fda1b29d0f6268cf6524e13e508daf06f7d6ffe5 Mon Sep 17 00:00:00 2001 From: Mitchell Date: Mon, 29 Jul 2019 17:10:19 +1000 Subject: [PATCH] Added mdl_nm for compatibility with upcoming feature #96 --- R/fable.R | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/R/fable.R b/R/fable.R index 586ab5ef..189c27bd 100644 --- a/R/fable.R +++ b/R/fable.R @@ -54,7 +54,8 @@ as_fable.tbl_ts <- function(x, response, distribution, ...){ } fbl <- new_tsibble(x, class = "fbl_ts", - response = response, dist = enexpr(distribution)) + response = response, dist = enexpr(distribution), + mdl_nm = ".model") validate_fable(fbl) fbl } @@ -76,7 +77,8 @@ as_fable.grouped_ts <- function(x, response, distribution, ...){ fbl <- structure(x, class = c("grouped_fbl", "grouped_ts", "grouped_df", "fbl_ts", "tbl_ts", "tbl_df", "tbl", "data.frame"), - response = response, dist = enexpr(distribution)) + response = response, dist = enexpr(distribution), + mdl_nm = ".model") validate_fable(fbl) fbl } @@ -113,7 +115,7 @@ as_tsibble.fbl_ts <- function(x, ...){ #' @export as_tsibble.grouped_fbl <- function(x, ...){ structure(x, class=setdiff(class(x), c("grouped_fbl", "fbl_ts")), - response = NULL, dist = NULL) + response = NULL, dist = NULL, mdl_nm = NULL) } validate_fable <- function(fbl){