Use highcharter inside a function
问题 How do I use highcharter::hchart inside a function? Here is a simple line graph using the hchart function. library(tidyverse) library(lubridate) library(highcharter) library(nycflights13) flights_2 <- flights %>% mutate(dep_mo = ymd(str_c(year, month, "01", sep = "-"))) %>% group_by(dep_mo) %>% summarize(arr_delay = mean(arr_delay, na.rm = TRUE)) hchart(flights_2, type = "line", hcaes(x = dep_mo, y = arr_delay), name = "Average Arrival Delay") When I try to write a function to create the same