viz_residuals.Rd
Residual plot of model
viz_residuals(fit, new_data)
fit | a parsnip model object |
---|---|
new_data | A data frame or matrix. |
a ggplot2 object
library(parsnip) reg <- linear_reg() %>% set_engine("lm") %>% set_mode("regression") %>% fit(mpg ~ ., data = mtcars) viz_residuals(reg, mtcars)linear_reg() %>% set_engine("lm") %>% set_mode("regression") %>% fit(mpg ~ ., data = mtcars) %>% viz_residuals(mtcars)