fsolt / dotwhisker

Dot-and-Whisker Plots of Regression Results
https://fsolt.org/dotwhisker/
Other
60 stars 10 forks source link

`relabel_predictors` messes up the dodges #67

Closed sammo3182 closed 7 years ago

sammo3182 commented 7 years ago

For some unknown reason, dwplot project after relabel_predictors failed to call the dodge_size correctly. See the example in the following codes from the vignette:

dwplot(list(m1, m2, m3)) %>% 
    relabel_predictors(c(wt = "Weight",                       
                         cyl = "Cylinders", 
                         disp = "Displacement", 
                         hp = "Horsepower", 
                         gear = "Gears", 
                         am = "Manual")) +
     theme_bw() + xlab("Coefficient Estimate") + ylab("") +
     geom_vline(xintercept = 0, colour = "grey60", linetype = 2) +
     ggtitle("Predicting Gas Mileage") +
     theme(plot.title = element_text(face="bold"),
           legend.justification=c(0, 0), legend.position=c(0, 0),
           legend.background = element_rect(colour="grey80"),
           legend.title = element_blank())