title: Filter for RenderDatatable
body: <p>I have a simple data where I need to apply filter for renderDatatable (not renderTable). But I am not able to execute the below code</p>
  
  <pre><code>as &lt;- data.frame(ColA = c("India","USA","Canada","India","USA","Canada","Australia"),ColB=c("A","B","C","D","E","F","G"),ColC=c("Jan","Jan","Mar","Feb","Jan","Apr","Apr"))
  library(shiny)
  library(DT)
  ui &lt;- fluidPage(
  sidebarLayout(
  sidebarPanel(selectInput("x","Operations",choices = 
                             c("table"),
                           multiple=FALSE,selectize = TRUE),
               (selectInput("ColB","Choices from ColB", choices = as$ColB,
                            multiple=TRUE,selectize = TRUE))),
  mainPanel(h6("Here it is"),
            dataTableOutput("message")
  )
  )
  )
  server &lt;- function(input, output, session) {
  r1 &lt;- reactive({
  if(input$x == "table")
  {
    tab &lt;- as.data.frame.matrix(table(as$ColC, as$ColA))
    tab &lt;- tab[rownames(tab) %in% input$ColB, ]
  }
  })
  output$message &lt;- renderDataTable({
  datatable(r1(), rownames = TRUE)
  })
  }
  shinyApp(ui, server)
  </code></pre>