echarts4r
echarts4r copied to clipboard
rename grouped variable
Hello and I hope you are having a great day. I wanted to know if there is a possibility to rename observations when they are grouped. I tried to rename the following example but I couldn't get it to work :(
iris |>
group_by(Species) |>
e_charts(Sepal.Length) |>
e_scatter(Sepal.Width, name = c("example 1", "example 2", "example 3")) |>
e_tooltip(trigger = "axis")
Thanks for the help
Hi Jorge-hercas,
I am not entirely sure what you intend, but can't you solve your problem within dplyr
instead of echarts4r
, like this:
iris |>
group_by(Species) |> mutate(Species = case_when(
Species == "setosa" ~ "example 1",
Species == "versicolor" ~ "example 2",
Species == "virginica" ~ "example 3",
)) |>
e_charts(Sepal.Length) |>
e_scatter(Sepal.Width) |>
e_tooltip(trigger = "axis")