title: R - How do I use selectInput in shiny to change the x and fill variables in a ggplot renderPlot?
body: <p>I'm trying to make an interactive shiny dashboard that has an interactive plot where you can change the values of the plot. The code chunk that I'm putting inside of renderPlot works normally, so I don't understand why count isn't showing on the y axis when I use selectInput to change the X and Fill variables.</p>
  
  <pre><code> inputPanel(
    selectInput('x', 'X', names(data)),
    selectInput('y', 'Y', names(data))
  )
  
  renderPlot({
      ggplot(data, aes(x = input$x)) +
    geom_bar(aes(fill = input$y), position = position_stack(reverse = TRUE)) +
   coord_flip() + 
   theme(legend.position = "top")
  })
  </code></pre>