score:1

Accepted answer

You can use the following code

library(dplyr)
library(highcharter) 

data(pokemon) 

dat <- data_to_boxplot(pokemon, height)

highchart() %>%
  hc_xAxis(type = "category") %>%
  hc_add_series_list(dat)

dat <- data_to_boxplot(pokemon, height, type_1, name = "height in meters")

my_data <- pokemon %>% 
  group_by(type_1) %>% 
  summarise(Mean = mean(height))

highchart() %>%
  hc_xAxis(type = "category") %>%
  hc_add_series_list(dat) %>%
  hc_add_series(name = "Mean",
    data = my_data,
    type = "scatter",
    hcaes(x = "type_1", y = "my_data$Mean")
  )

enter image description here


Related Query

More Query from same tag