diff --git a/R/refit.R b/R/refit.R index 5607b40a..a4fb64ab 100644 --- a/R/refit.R +++ b/R/refit.R @@ -23,17 +23,17 @@ #' @rdname refit #' @export refit.mdl_df <- function(object, new_data, ...){ - object %>% - bind_new_data(new_data) %>% - gather(".model", ".fit", !!!syms(object%@%"models")) %>% - as_tibble %>% - transmute( - !!!key(object), - !!sym(".model"), - .fit = map2(!!sym(".fit"), !!sym("new_data"), refit, ...) - ) %>% - spread(".model", ".fit") %>% - as_mable(key = key(object), models = object%@%"models") + mdls <- syms(object%@%"models") + new_data <- bind_new_data(object, new_data) + + object %>% + dplyr::mutate_at(vars(!!!mdls), + refit, new_data[["new_data"]], ...) +} + +#' @export +refit.lst_mdl <- function(object, new_data, ...){ + `class<-`(map2(object, new_data, refit, ...), class(object)) } #' @rdname refit diff --git a/cran-comments.md b/cran-comments.md index 2fb74164..6093a5a4 100644 --- a/cran-comments.md +++ b/cran-comments.md @@ -14,3 +14,7 @@ This submission resolves issues with a soon to be released version of tibble. ## revdep checks All revdeps have been checked. + +## Resubmission + +Fix issue with revdep checks for fable. \ No newline at end of file