title: How to make an interactive checklist in Rstudio Shiny
body: <p>I'm trying to build a checklist that will show me different parts of my data in Rstudio using Shiny.</p>
  
  <p>For example:
  If I check question A:
  Row 1:2 should show in my table
  If I check question B while A is still checked:
  I want to see row 1:2 &amp; 5.
  If I uncheck question B but check question C while A is still checked:
  I want to see row 1:2 &amp; 3:4</p>
  
  <p>I made 2 versions but I'm stuck on both</p>
  
  <p>Version 1 (were I'm having trouble with the if statements in the server):</p>
  
  <pre><code>if (interactive()) {
  
  library(shiny)
  library(readxl)
  Sheet2 &lt;- read_excel("Sheet2.xlsx")
  Sheet3 &lt;- read_excel("Sheet3.xlsx")
  Sheet4 &lt;- read_excel("Sheet4.xlsx")
  
  
  
  ui &lt;- fluidPage(
    title = "Checklist",
    sidebarLayout(
      sidebarPanel(   
  
        checkboxInput(inputId = "A",
                                    label = strong("A"),
                                    value = FALSE),
  
        conditionalPanel(condition = "input.A == true", 
                         checkboxInput(inputId = "B",
                                       label = strong("B"),
                                       value = FALSE)),
  
        checkboxInput(inputId = "C",
                      label = strong("C"),
                      value = FALSE)
  
        ),
      mainPanel(
        tabsetPanel(
          id = 'dataset',
          tabPanel("Sheet2", DT::dataTableOutput("mytable1")),
          tabPanel("Sheet3", DT::dataTableOutput("mytable2")),
          tabPanel("Sheet4", DT::dataTableOutput("mytable3"))
        )
      )
    )
  )
  
  server &lt;- function(input, output) {
  
    output$mytable1 &lt;- 
      DT::renderDataTable({
        if (input$A){
          DT::datatable(Sheet2[1:2,])}
        if (input$C){
          DT::datatable(Sheet2[3:4,])}
        if (input$B){
          DT::datatable(Sheet2[5,])
        }
      })
  
  
    output$mytable3 &lt;- 
      DT::renderDataTable({if ((input$A)){
        DT::datatable(Sheet3[3:4,])}
      })
  
  }
  
  shinyApp(ui, server)
  
  }
  </code></pre>
  
  <hr>
  
  <p>And version 2 (were i cant add multiple rows to my groupinput):</p>
  
  <pre><code>if (interactive()) {
  library(shiny)
  library(readxl)
  Sheet2 &lt;- read_excel("Sheet2.xlsx")
  Sheet3 &lt;- read_excel("Sheet3.xlsx")
  Sheet4 &lt;- read_excel("Sheet4.xlsx")
  B3 &lt;- 3:4
  
  
  ui2 &lt;- fluidPage(
    title = "M&amp;A Checklist",
      mainPanel(
        tabsetPanel(
          id = 'dataset',
          tabPanel("Sheet1", checkboxGroupInput(inputId = "show_vars", 
                                                label = "Questions:", 
                                                choiceNames = c("AAAAAAAAAA","BBBBBBBBBB","CCCCCCCCCCC"), 
                                                choiceValues = c("1","B3","5") )),
          tabPanel("Sheet2", DT::dataTableOutput("mytable1")),
          tabPanel("Sheet3", DT::dataTableOutput("mytable2")),
          tabPanel("Sheet4", DT::dataTableOutput("mytable3"))
      )
    )
  )
  
  server2 &lt;- function(input, output) {
  
    # choose columns to display
    output$mytable1 &lt;- DT::renderDataTable({
      DT::datatable(Sheet2[input$show_vars,])
    })
  
    # sorted columns are colored now because CSS are attached to them
    output$mytable2 &lt;- DT::renderDataTable({
      DT::datatable(Sheet3[input$show_vars,])
    })
  
    # customize the length drop-down menu; display 5 rows per page by default
    output$mytable3 &lt;- DT::renderDataTable({
      DT::datatable(Sheet4[input$show_vars,] )
    })
  
  }
  
  shinyApp(ui2, server2)
  }
  </code></pre>
  
  <p>Any suggestions, on how this can be done efficiently?</p>