-
Notifications
You must be signed in to change notification settings - Fork 130
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
order of facets in ggcoef_compare() #426
Comments
Should be fixed in #427 library(GGally)
#> Le chargement a nécessité le package : ggplot2
#> Registered S3 method overwritten by 'GGally':
#> method from
#> +.gg ggplot2
m1 <- lm(Fertility ~ Education + Catholic, data = swiss)
m2 <- lm(Fertility ~ Education + Catholic + Agriculture, data = swiss)
m3 <- lm(Fertility ~ Education + Catholic + Agriculture + Infant.Mortality, data = swiss)
ggcoef_compare(models = list(m1, m2, m3)) Created on 2021-10-24 by the reprex package (v2.0.1) |
In the meantime, you will find below a way to control the order of the facets with the current version of GGally. You need call directly library(GGally) # current stable version
#> Le chargement a nécessité le package : ggplot2
#> Registered S3 method overwritten by 'GGally':
#> method from
#> +.gg ggplot2
library(tidyverse)
m1 <- lm(Fertility ~ Education + Catholic, data = swiss)
m2 <- lm(Fertility ~ Education + Catholic + Agriculture, data = swiss)
m3 <- lm(Fertility ~ Education + Catholic + Agriculture + Infant.Mortality, data = swiss)
# incorrect order
ggcoef_compare(models = list(m1, m2, m3)) # temporary fix
d <- ggcoef_compare(models = list(m1, m2, m3), return_data = TRUE)
d <- d %>% arrange(model, var_label)
ggcoef_plot(d, colour = "model", dodged = TRUE) Created on 2021-10-24 by the reprex package (v2.0.1) |
Great. Thanks |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Asked on community RStudio without much success.
Is there a way to control the order of the facets from a
ggcoef_compare()
plot?Would it not be more intuitive if the facets followed a default order of the variables entering the model building process (Education, Catholic, Agriculture, Infant.Mortality in the example above) ?
The text was updated successfully, but these errors were encountered: