Como salvar a classificação no dataTable de forma brilhante?
Eu tenho tabela na página com possível classificação em colunas; depois que eu recarregar os dados com a tabela reativa não é classificada novamente, aqui o código server.R:
library(shiny)
shinyServer(function(input, output) {
# Return the requested dataset
datasetInput <- reactive({
switch(input$dataset2,
"[,...]" = diamonds,
"[10:30,...]" = diamonds,
"[31:50,...]" = diamonds)
})
#"[,...]" = diamonds[,],
#"[10:30,...]" = diamonds[10:30,],
#"[31:50,...]" = diamonds[31:50,])
# Show the first "n" observations
output$view <- renderTable({
head(datasetInput())
})
# a large table, reative to input$show_vars
output$mytable1 <- renderDataTable({
library(ggplot2)
datasetInput()[, input$show_vars, drop = FALSE]
})
})