What is the underscore function in R? For example, the following code string: ; determines that the currently displayed data is placed in a variable ; however, if I change it to , all filtered data will be placed in a variable .input$tbl_rows_currentfiltered_datainput$tbl_rows_allfiltered data
I understand how it functions here, but what is its general use?
ui = fluidPage(dataTableOutput('tbl'),
plotOutput('plot1')
)
server = function(input, output) {
output$tbl = renderDataTable({
datatable(KSI, filter="top",rownames=TRUE,options = list(lengthChange = FALSE))
})
output$plot1 = renderPlot({
filtered_data <- as.numeric(*input$tbl_rows_current*)
print(filtered_data)
})
}
shinyApp(ui=ui, server=server)
B.Doe source
share