Closed
Description
Currently the augment()
function matched the input class. It would be nice if it returned tibbles to match predict()
library(parsnip)
lm_spec <- linear_reg() %>%
set_engine("lm")
lm_fit <- lm_spec %>% fit(mpg ~ ., data = mtcars)
class(mtcars)
#> [1] "data.frame"
predict(lm_fit, new_data = mtcars) %>% class()
#> [1] "tbl_df" "tbl" "data.frame"
augment(lm_fit, new_data = mtcars) %>% class()
#> [1] "data.frame"
augment(lm_fit, new_data = tibble::as_tibble(mtcars)) %>% class()
#> [1] "tbl_df" "tbl" "data.frame"
Created on 2021-04-09 by the reprex package (v1.0.0)