title: Using selectInput in shiny R to select and filter rows, not select columns
body: <p>I am attempting to filter rows from a data frame, such as "mtcars", using the selectInput function in shiny. So a user will select which car he wants to view and the outputTable will show only stats from the selected car. In the selectInput example, the selection works on columns:</p>
  
  <pre><code>## Only run examples in interactive R sessions
  if (interactive()) {
  
  # basic example
  shinyApp(
    ui = fluidPage(
      selectInput("variable", "Variable:",
                  c("Cylinders" = "cyl",
                    "Transmission" = "am",
                    "Gears" = "gear")),
      tableOutput("data")
    ),
    server = function(input, output) {
      output$data &lt;- renderTable({
        mtcars[, c("mpg", input$variable), drop = FALSE]
      }, rownames = TRUE)
    }
  )
  }
  </code></pre>
  
  <p>However, I am trying to use dplyr to filter out the cars based on the user input selected car: </p>
  
  <pre><code>library(shiny)
  library(dplyr)
  
  #####Just adding a column name to mtcars for the cars column####
  #cars &lt;- mtcars
  #mtcars &lt;-setNames(cbind(rownames(cars), cars, row.names = NULL), 
  #                  c("cars", "mpg", "cyl", "disp", "hp", "drat", "wt", "qsec", "vs", "am", "gear", "carb"))
  
  if (interactive()) {
  
    shinyApp(
      ui = fluidPage(
        selectInput("variable", "Pick a Car: ",
                    c("All" = "All Cars",
                      "Ford" = "Ford",
                      "Volvo" = "Volvo",
                      "Ferrari" = "Ferrari",
                      "Fiat" = "Fiat",
                      "Merc" = "Merc")),
        tableOutput("data")
      ),
  
  
      server = function(input, output) {
  
        output$cars &lt;- renderText({
          mtcars %&gt;%
            filter(mtcars$cars %in% as.character(input$variable))
        })
  
        output$data &lt;- renderTable({
          output$cars
        })
  
      }
    )
  }
  </code></pre>
  
  <p>Any suggestions will be much appreciated!</p>