# these examples can only be run if package 'broom' is available
if (requireNamespace("broom", quietly = TRUE)) {
library(broom)
mod <- lm(mpg ~ wt + qsec, data = mtcars)
attr(keep_tidy(mod), "fm")[["class"]]
attr(keep_glance(mod), "fm")[["class"]]
attr(keep_augment(mod), "fm")[["class"]]
attr(keep_tidy(summary(mod)), "fm")[["class"]]
library(MASS)
rmod <- rlm(mpg ~ wt + qsec, data = mtcars)
attr(keep_tidy(rmod), "fm")[["class"]]
}
Run the code above in your browser using DataLab