【问题标题】:Disable warning when using large datatables in R markdown在 R markdown 中使用大型数据表时禁用警告
【发布时间】:2020-03-02 03:59:06
【问题描述】:

我在 Rmarkdown 文件中使用DT::datatable 来输出一个包含 58302 行和 6 列的表。根据我阅读的内容,我不能在 Rmarkdown 中使用服务器端处理,所以我必须使用默认客户端来呈现数据表。我收到以下警告,该警告显示在 markdown html 输出中:

Warning in instance$preRenderHook(instance): It seems your data is too
big for client-side DataTables. You may consider server-side processing:
https://rstudio.github.io/DT/server.html

如何禁用它?

【问题讨论】:

  • 可以在chunk中设置选项warning=FALSE
  • @StéphaneLaurent 你能把这个移到答案吗?

标签: r datatable r-markdown dt


【解决方案1】:

老问题,但接受的答案对我不起作用。但是,设置一个选项确实可以抑制警告:

options(DT.warn.size=FALSE)

【讨论】:

    【解决方案2】:

    在R块的选项中,设置warning=FALSE:

    ```{r mytable, warning=FALSE}
    ......
    ```
    

    【讨论】:

      猜你喜欢
      • 2019-07-17
      • 1970-01-01
      • 2019-04-26
      • 2020-11-16
      • 2020-04-12
      • 2014-05-08
      • 1970-01-01
      • 2013-08-03
      • 1970-01-01
      相关资源
      最近更新 更多