R降价:将HTML表格下载到Excel文件

时间:2018-12-11 16:24:27

标签: html r markdown r-markdown kable

我有一个R标记,用于构建表格,我想添加将表格下载到Excel文件的选项。

kable(MyTable) %>%
  kable_styling(bootstrap_options = c("striped", "hover", "condensed", 
  "responsive")) %>%
  scroll_box(width = "900px", height = "500px")

1 个答案:

答案 0 :(得分:2)

您始终可以尝试使用DT::datatable来获取导出按钮

MyTable %>%
  DT::datatable(
    extensions = 'Buttons', 
    options = list(dom = 'Bfrtip', 
                   buttons = c('excel', "csv")))