Just building up on @JasonAizkalns's example, you can hide some of the built-in column filters using jQuery. for example here the first two are hidden:
library(shiny)
library(DT)
shinyApp(
ui = fluidPage(dataTableOutput('tbl'),
plotOutput('plot1')),
server = function(input, output) {
output$tbl = renderDataTable({
datatable(iris, filter="top",options = list(lengthChange = FALSE),callback=JS("
//hide column filters for the first two columns
$.each([0, 1], function(i, v) {
$('input.form-control').eq(v).hide()
});"))
})
output$plot1 = renderPlot({
filtered_data <- input$tbl_rows_all
hist(iris[filtered_data, "Sepal.Length"])
})
}
)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…