install.packages('shiny', type = 'source')
ui.r:
library(shiny)
shinyUI(bootstrapPage(
dataTableOutput('tbl')
))
server.r:
library(shiny)
shinyServer(function(input, output) {
output$tbl <- renderDataTable({
data.frame(x = 1:10, y = c(1, 1, 2, 2, 3, 3, 4, 4, 5, 5))
})
})
From the dataTables description: http://datatables.net/examples/basic_init/multi_col_sort.html
"This multiple sorting mechanism is always active if the bSort initialiser is true (it is by default) and the end user can activate it by 'shift' clicking on the column they want to add to the sort."
Thus, when you run this application, try sorting by "y" and then shift-clicking x (watch the purple-highlighted arrows in the column heading), to see that the "y" column remains sorted, while the "x" column changes the sort-order leaving y fixed.