title: Shiny R GGplot Barplot showing wrong values when dataset it's based on shows correct one
body: <p>I have a shinydashboard app where I want to be able to reactively subset data by multiple variables and then create a barplot of the resulting subset. </p>
  
  <p>I've successfully created the reactive subsetting but the barplot shows, every time, that the y values are the same for every x values, even though the printed subset shows they have different values.</p>
  
  <p><a href="https://i.stack.imgur.com/o7FkM.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/o7FkM.png" alt="enter image description here"></a></p>
  
  <p>Relevant UI: </p>
  
  <pre><code>tabItem(tabName = "subset",
                              fluidRow(
                                box( uiOutput("codePanel")),
                                box(selectInput("groupDset", label="Select Category",
                                                choices = list("Evaluation"="evaluation",
                                                               "Incidence"="incidence",
                                                               "Involvement"="involve_idx",
                                                               "Funny" = "atts_raw_fun",
                                                               "Edgy" = "atts_raw_edgy",
                                                               "Disturbing" = "atts_raw_disturbing",
                                                               "Dramatic"= "atts_raw_dramatic",
                                                               "Mindless"= "atts_raw_mindless",
                                                               "Calming"= "atts_raw_calming",
                                                               "Intelligent"= "atts_raw_intelligent",
                                                               "Informative"= "atts_raw_informative",
                                                               "Scary"= "atts_raw_scary",
                                                               "Funny"= "atts_raw_funny",
                                                               "Relatable"= "atts_raw_relatable",
                                                               "Mean"= "atts_raw_mean",
                                                               "Size"="n_size"), selected = "evaluation")),
                                box(plotOutput(outputId = "bar1"))),
  
                              fluidRow(
                                box(width=NULL, DT::dataTableOutput("text"),style = "height:500px; overflow-y: scroll;overflow-x: scroll;"))
                                ),
  </code></pre>
  
  <p>This is the server side</p>
  
  <pre><code>filt &lt;- selectInput("codeInput",label ="choose code",
                    choices = as.list(unique(data$show_name)))
  
   output$codePanel &lt;- renderUI({ filt
  
  })
  
  dataset&lt;-reactive({ 
  
   subset(data, show_name == input$codeInput)  
  
   })
    dataset2&lt;-reactive({ 
  
  subset(dataset(), select = c(input$groupDset,"grp_lev"))
  
    })
  
  
  output$text&lt;-renderDataTable(dataset())
  output$text2&lt;-renderDataTable(dataset2())
  
   #This plot seems to say that input$groupDset is a constant
  output$bar1&lt;-renderPlot({
  ggplot(data=dataset2(), aes(x=grp_lev, y=input$groupDset, fill=grp_lev)) + geom_bar(stat = "identity")
  }) 
  </code></pre>
  
  <p>When the plot is run from outside the shiny app with the same variables, but static, it works as expected and the y axis has tick marks. When called from the app, the y axis isn't articulated which makes me thing that <code>input$groupDset</code> must be the wrong data type. Running it <code>y=as.numeric(input$groupDset)</code> threw an error. Maybe because dataset2 is a closure function, the subsetting has to be formatted differently to slice it by reactive column value? </p>
  
  <p><a href="https://i.stack.imgur.com/6hmVM.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/6hmVM.png" alt="enter image description here"></a></p>
  
  <pre><code>    ggplot(data=subset(data, show_name =='Show 1'), aes(x=grp_lev, y= incidence, fill=grp_lev)) + geom_bar(stat = "identity")
  </code></pre>