What is the function of an underscore in R? For example, in the code below, the line: input$tbl_rows_current
; determines that the current data being displayed is placed into the variable filtered_data
; however, if I change it to input$tbl_rows_all
, all the data filtered is placed into the variable filtered 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)