My current issue is that I'm having trouble adding a summary row that shows total of a column/columns of a Shiny datatable that has an inbuilt filter (the one that you add in using the filter option). Specifically, I am able to show the total of the current page I'm in, but I'd like a fixed row where it shows the total across all pages. Can anyone show this using the iris dataset?
Here is a reproducible code:
library(shiny)
library(DT)
server <- function(input, output, session) {
output$mytable <- DT::renderDataTable(iris,
filter = 'top')
#would like to add summary row of totals for each column that would change accordingly once filter is applied
}
ui <- fluidPage(
DT::dataTableOutput('mytable')
)
shinyApp(ui = ui, server = server)