0

So I have a dashboard that I built out, and the code looks like this:

Server

shinyServer(function(input, output) {

output$table <- DT::renderDataTable(DT::datatable({
data <- cancel_reason_month
if (input$rep != "All") {
  data <- data[data$'Cohort Month' == input$rep,]
}
data
}))

})

UI

shinyUI(
fluidPage(
titlePanel("Breakdown"),

fluidRow(
  column(4,
         selectInput("rep",
                     "Cancel Month:",
                     c("All",
                       unique(as.character(cancel_reason_month$`Cohort Month`))))
  )
),
fluidRow(
  DT::dataTableOutput("table")
)
)
) 

The end results is a dashboard that looks like this.

So you can see I currently have a drop down menu where you can select the month, but that's not what I'm trying to do.

Lets say I only want to see data from July and August of 2016, how could I do that? Is there some sort of checkboxn widget where I can select the options I want?

Additionally, how could I add subtotals to the bottom that will change with the data I'm selecting (i.e. If I select July and August, the resulting subtotals for the columns will ONLY reflect July and August.)

0 Answers0