Reputation: 5249
To perhaps save a few people a minute or two ... this question is about DataTables in a Shiny app (http://shiny.rstudio.com/articles/datatables.html) and not Data.Table
I would like to access the index of rows available in DataTables in Shiny. I do not want to save the filtered data as a csv file but, rather, add the data.frame to a dropdown of datasets the app user can work with. I am using reactive values to store data.frames and I don't expect too much trouble adding the file/data to the dropdown list once I can access the data.frame (or row index).
Although, again, I do not want to rely on tabletools or similar, to save data to disk, there are several questions related to mine (see link below). However, there must be an easier way to access the filtered data-frame in a shiny-app. If not, perhaps there should be :)
I was hoping I might be able to use renderDataTable but I am not sure how that would work.
Saving from Shiny renderDataTable
Upvotes: 4
Views: 1184
Reputation: 5249
Thanks to @yihui this is now possible using the DT package and input$tableId_rows_all
where tableID
is the id assigned to your table. See the link below for details.
http://rstudio.github.io/DT/shiny.html
Upvotes: 1