0

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)
Thomas Kim
  • 13
  • 3
  • Welcome to SO, Thomas Kim! Please make this question *reproducible*. This includes sample code you've attempted (including listing non-base R packages, and any errors/warnings received), sample *unambiguous* data (e.g., `data.frame(x=...,y=...)` or the output from `dput(head(x))`), and intended output given that input. Refs: https://stackoverflow.com/q/5963269, [mcve], and https://stackoverflow.com/tags/r/info. – r2evans Jan 24 '22 at 19:21
  • Please provide enough code so others can better understand or reproduce the problem. – Community Jan 31 '22 at 14:07

0 Answers0