# Small function to display plots only if it's interactive
p_ <- GGally::print_if_interactive
library(broom)
reg <- lm(Sepal.Length ~ Sepal.Width + Petal.Length + Petal.Width, data = iris)
p_(ggcoef(reg))
# \donttest{
d <- as.data.frame(Titanic)
reg2 <- glm(Survived ~ Sex + Age + Class, family = binomial, data = d, weights = d$Freq)
ggcoef(reg2, exponentiate = TRUE)
ggcoef(
reg2,
exponentiate = TRUE, exclude_intercept = TRUE,
errorbar_height = .2, color = "blue", sort = "ascending"
)
# }
Run the code above in your browser using DataLab