In the preceding example application, we saw how to make our plot interactive. Now it's time to make tables interactive. Interactive plots mean we can have freedom in selecting rows/columns/cells and shorting columns.
DT is a package with DT library that helps us to make tables more interactive. Let's see a small client-side example of Data Tables with Shiny:
library(shiny) library(DT) shinyApp( ui = fluidPage(DTOutput('tbl')), server = function(input, output) { output$tbl = renderDT( iris, options = list(lengthChange = FALSE) ) })
In the preceding code, DTOutput() is for outputting the table on UI, and on the server side we have used renderDT() to send the data into the UI from the iris dataset. The output can be seen here:
We can see in the preceding screenshot that we can select rows using a mouse pointer....