Closed judgelord closed 2 years ago
A minor issue, but labs(caption) gets repeated under brackets. Thanks for this package!
reprex:
library(broom) library(dplyr) data(mtcars) m1 <- lm(mpg ~ wt + cyl + disp, data = mtcars) %>% tidy() two_brackets <- list(c("Engine", "Cylinder", "Displacement"), c("Not Engine", "Intercept", "Weight")) {dwplot(m1, show_intercept = T) %>% relabel_predictors("(Intercept)" = "Intercept", wt = "Weight", cyl = "Cylinder", disp = "Displacement") + labs(caption = "mtcars data")} %>% add_brackets(two_brackets)
A solution could be to draw the caption after the add_brackets
library(broom)
library(dplyr)
library(dotwhisker)
data(mtcars)
m1 <- lm(mpg ~ wt + cyl + disp, data = mtcars) %>%
tidy()
two_brackets <- list(c("Engine", "Cylinder", "Displacement"),
c("Not Engine", "Intercept", "Weight"))
{dwplot(m1, show_intercept = T) %>%
relabel_predictors("(Intercept)" = "Intercept",
wt = "Weight",
cyl = "Cylinder",
disp = "Displacement")} %>%
add_brackets(two_brackets) +
labs(caption = "mtcars data")
A minor issue, but labs(caption) gets repeated under brackets. Thanks for this package!
reprex: