简体   繁体   English

R Shiny:使用 DT::renderDataTable 下载整个数据集

[英]R Shiny: download the whole dataset with DT::renderDataTable

I am using DT::renderDataTable and DT::datatable with extension 'Buttons' to allow user to download a table in R Shiny app.我正在使用 DT::renderDataTable 和 DT::datatable 扩展“按钮”,以允许用户在 R Shiny 应用程序中下载表格。

With this script, the user can download data he sees on his screen (eg: User uses the selector to show 1 to 25 of 50 entries and clicks on donwload button: only the 1 to 25 rows will be downloaded)使用此脚本,用户可以下载他在屏幕上看到的数据(例如:用户使用选择器显示 50 个条目中的 1 到 25 个并单击下载按钮:只会下载 1 到 25 行)

Is there a way to modify the button behviours to allow user to download the whole dataset (50 rows)?有没有办法修改按钮行为以允许用户下载整个数据集(50 行)?

Thanks for your help!谢谢你的帮助!

Here is my current script:这是我当前的脚本:

output$mytable2  <- DT::renderDataTable(
                            DT::datatable(
                                { plots.dfs()[[2]] },

                                extensions = 'Buttons',

                                options = list(                                                     
                                    fixedColumns = TRUE,
                                    autoWidth = TRUE,
                                    ordering = TRUE,
                                    dom = 'Bliftsp',
                                    buttons = c('copy', 'csv', 'excel')
                                ),


                                class = "display"
                           ))

Use the server = FALSE argument to renderDataTable .server = FALSE参数用于renderDataTable

ref : rstudio.github.io/DT/server.html参考: rstudio.github.io/DT/server.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM