Skip to content
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

Add "order" or "sort" option to ggpredict plot options #339

Open
jbohenek opened this issue Jun 14, 2023 · 2 comments
Open

Add "order" or "sort" option to ggpredict plot options #339

jbohenek opened this issue Jun 14, 2023 · 2 comments
Labels
enhancement 💥 Implemented features can be improved or revised

Comments

@jbohenek
Copy link

Hey all,

First - I love the package. I teach it in my R course. Thanks for making such a useful package.

Would it be possible to implement an effect ordering option for plotting ggpredict objects? For example, you plot many effect estimates and you want to order them by size (either ascending or descending). Typically, one would do this by hand, but that would require remaking the prediction df and ordering variables, which is a tedious step that ggpredict allows us to skip entirely (thank god).
e.g.,

ggpredict(fit, ~x) |> plot(order=T)

Ben Bolker has a utility function to do with dot whisker plots available on his github. Perhaps something similar could be implemented? https://github.com/eco4cast/Statistical-Methods-Seminar-Series/blob/main/bolker_mixedmodels/utils.R

If this option is already available, then I feel stupid :)

-Cheers
J

@strengejacke strengejacke added feature idea 🔥 enhancement 💥 Implemented features can be improved or revised and removed feature idea 🔥 labels Aug 21, 2023
@strengejacke
Copy link
Owner

This is only needed/useful for categorical focal terms, right?

@jbohenek
Copy link
Author

Yes, what I currently do is convert to tibble, sort, and then construct my own ggplot.

ap_duck3_ss<-ggemmeans(gam4,~species*site) |> as_tibble() |> mutate(x = fct_reorder (x,predicted))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement 💥 Implemented features can be improved or revised
Projects
None yet
Development

No branches or pull requests

2 participants