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

Grouped box plot with multiple variables #409

Open
guybrettrobertson opened this issue Feb 25, 2022 · 4 comments
Open

Grouped box plot with multiple variables #409

guybrettrobertson opened this issue Feb 25, 2022 · 4 comments
Assignees
Labels
enhancement New feature or request

Comments

@guybrettrobertson
Copy link

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
unnamed-chunk-1-1

I have tried the following:

variety = rep(LETTERS[1:7], each=40)
treatment = rep(c("high","low"),each=20)
note = seq(1:280)+sample(1:150, 280, replace=T)

data.frame(variety, treatment ,  note) |>
  echarts4r::group_by(variety, treatment) |>
  echarts4r::e_charts() |>
  echarts4r::e_boxplot(note) |>
  echarts4r::e_legend()

But it gives me this:
Rplot

I have also tried using e_add_nested but it doesn't seem to work for boxplots.

@guybrettrobertson
Copy link
Author

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?

@sandra-ab
Copy link

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. :)

@JohnCoene
Copy link
Owner

#253

@munoztd0
Copy link
Collaborator

munoztd0 commented Aug 3, 2022

Created a gist function to do it -> https://gist.github.com/munoztd0/c860717d1f29e8a1b9114c46e945202e

#253 (comment)

@munoztd0 munoztd0 self-assigned this Jun 12, 2023
@munoztd0 munoztd0 added the enhancement New feature or request label Jun 12, 2023
@munoztd0 munoztd0 pinned this issue Jun 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants