我怎样才能使高图图表显示在RMarkdown中?

时间:2019-02-19 14:05:29

标签: r highcharts data-visualization htmlwidgets

我正在创建一个html文档,并希望包括交互式可视化。当我在RStudio中使用highcharter时,我的图形显示完美,但是当我在RMarkdown中放置相同的代码时,我不断收到错误消息:“找不到函数'hchart';找不到函数'hcaes'”。

我一直在使用此页面作为指南,但无法显示图形: https://www.kaggle.com/nulldata/beginners-guide-to-highchart-visual-in-r/code

这是我尝试使用的代码:

highcharter::hchart(TEST,
         type = "column",
         hcaes(x = `Service.Month`,
               y = value,
               group = variable)) %>%
    hc_exporting(enabled = TRUE) %>%
    hc_xAxis(title = list(text = "Service Month")) %>%
    hc_yAxis(title = list(text = "Total Number")) %>%
    hc_tooltip(crosshairs = TRUE,
               backgroundColor = "#FCFFC5",
               shared = TRUE) %>%
    hc_title(text = "Title")

0 个答案:

没有答案