Skip to content

Commit

Permalink
Added mdl_nm for compatibility with upcoming feature
Browse files Browse the repository at this point in the history
  • Loading branch information
mitchelloharawild committed Jul 29, 2019
1 parent 6721c33 commit fda1b29
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions R/fable.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand All @@ -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
}
Expand Down Expand Up @@ -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){
Expand Down

0 comments on commit fda1b29

Please sign in to comment.