Closed svenb78 closed 1 year ago
Have you tried e_mark_line()
? A wrapper function, part of echarts4r. https://echarts4r.john-coene.com/reference/mark.html
Something like that
library(tidyverse) # has both dplyr and purrrrrr (how many r's?)
library(echarts4r)
mean_boxplot <- mtcars %>%
group_split(gear) %>%
imap(function(j, k) {
point <- j %>%
summarise(hp=round(mean(hp),0)) %>%
select(
yAxis = hp,
value = hp
) %>%
as.list()
j %>%
e_charts(time, name = paste0("chart_", as.character(k))) %>%
echarts4r::e_boxplot(hp) %>%
e_mark_line(data = point)
}) %>% append(c(rows = 1, cols = 3)) %>%
do.call(e_arrange, .)
mean_boxplot
Created on 2023-07-07 with reprex v2.0.2.9000
Hi,
given the following example:
How can I add within each boxplot a horizontal line for -- say -- the average?
According to apache documentation, boxplot has an argument called
markline
, but I don't know how to use it correctly.E.g., the following does not work in the sense of does not change the plot:
Thanks!