if (! requireNamespace("broom", quietly = TRUE)) {
stop("Please install 'broom' to run this example.")
}
lm1 <- lm(mpg ~ cyl, mtcars)
fixed_lm1 <- tidy_override(lm1,
p.value = c(.04, .12),
glance = list(r.squared = 0.99))
huxreg(lm1, fixed_lm1)
if (requireNamespace("nnet", quietly = TRUE)) {
mnl <- nnet::multinom(gear ~ mpg, mtcars)
tidied <- broom::tidy(mnl)
mnl4 <- tidy_replace(mnl, tidied[tidied$y.level == 4, ])
mnl5 <- tidy_replace(mnl, tidied[tidied$y.level == 5, ])
huxreg(mnl4, mnl5, statistics = "nobs")
}
Run the code above in your browser using DataLab