-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Add 'row.names' into ggplot_build(...)$data very useful for grouped geom_boxplot #4912
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
Comments
I might not understand your request, but, as the last example of https://ggplot2.tidyverse.org/reference/geom_boxplot.html#ref-examples |
Hi @yutannihilation, The feature request is just to add the row names by default to
Also, help page doesn't mention "only debugging, not for usability". |
I meant, |
I have to say that I don't understand the reasoning. But you already have I checked out if My main objective was to get a guarantied identifier of rows at Right not, |
|
Again, it's an internal data. Numeric is the internal representation. You might feel ok or not ok, but it is what it is. |
Hi.
After seeing in my boxplot that I may have some uncomplete groups of data under certain customer_ids, I wanted to see how filtering them out would change the behavior of all the rest.
My first idea was to gather the already calculated values in the drawn boxplot and filter the dataframe in order to draw it again.
Having successfully gathered the $data, I realized that my customer_ids are not listed on any column of the resulting dataframe. Instead, I saw a $y column with numeric values, which just guessing represents the order of the grouping variable.
Probably the plot object contains the grouping labels, but the "data" structure does not and it would help to have it.
Next code is meant to confirm that no labels are shown in $data, and finally assign them.
I had to confirm that the sequence of $y matched the order of the group, which is a factor() type.
I did that by fixing the seed and inspecting the resulting order in Rstudio.
However, this is not optimum as I don't have knowledge on how sorting and data types are handled internally.
The ideal is to preserve the original grouping names.
When writing this I found this question of 5 years ago
The text was updated successfully, but these errors were encountered: