-
-
Notifications
You must be signed in to change notification settings - Fork 81
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
Grouped box plot with multiple variables #409
Comments
I just noticed that has already come up in issue 253 but no clean solution was available at the time. Have any developments been made on this? |
I would love this feature too. I've been using bar charts as a workaround (where the multiple grouping works as expected), but often boxplots are just so much more appropriate. :) |
Created a gist function to do it -> https://gist.github.com/munoztd0/c860717d1f29e8a1b9114c46e945202e |
Hi, any news on this? Boxplots are so important for data visualizations and not being able to group by multiple variables is really surprising. Any workarounds? |
@sharp-lilac I agree with you is just that boxplots are not "normal" plots they are constituted of various diverse source of information (aggregated statistics as well a raw data points, i.e. outliers.) I started devloping a new branch that will implement a new approach for boxplots but it might get ugly at first, the commit 06c2e5d shows the first steps. On the branch grouped_boxplot: library(echarts4r)
data <- data.frame(
category = rep(LETTERS[1:5], each = 100),
value = rnorm(500, mean = rep(1:5, each = 100), sd = 1:5),
gender = sample(c("M", "F"), 500, replace = TRUE)
)
plot <- data |>
group_by(gender) |>
e_charts(category) |>
e_boxplot_group_(serie = "value") |>
e_x_axis(name = "Category") |>
e_y_axis(name = "Value") |>
e_tooltip(trigger = "axis") |>
e_legend(show = TRUE)
plot Created on 2024-11-25 with reprex v2.0.2 |
Hey, glad it kinda works. |
@munoztd0 Thank you! Exciting |
Is there a way to create a grouped box plot with multiple grouping variables using {echarts4r}?
I would like to create a grouped box plot with multiple variables comparable to this {ggplot2} plot: https://www.r-graph-gallery.com/265-grouped-boxplot-with-ggplot2.html
I have tried the following:
But it gives me this:
I have also tried using
e_add_nested
but it doesn't seem to work for boxplots.The text was updated successfully, but these errors were encountered: