title: Error in : `data` must be a data frame, or other object coercible by `fortify()`
body: <p>I am working on Shiny vizualization with 2 inputs.</p>
  <p>Dataset:</p>
  <pre><code>est_popai &lt;- data.frame(concat = c(&quot;A_1&quot;,&quot;B_1&quot;,&quot;C_1&quot;,&quot;A_2&quot;,&quot;B_2&quot;,&quot;C_2&quot;,&quot;A_1&quot;,&quot;B_1&quot;,&quot;C_1&quot;,&quot;A_2&quot;,&quot;B_2&quot;,&quot;C_2&quot;,&quot;A_1&quot;,&quot;B_1&quot;,&quot;C_1&quot;,&quot;A_2&quot;,&quot;B_2&quot;,&quot;C_2&quot;,&quot;A_1&quot;,&quot;B_1&quot;,&quot;C_1&quot;,&quot;A_2&quot;,&quot;B_2&quot;,&quot;C_2&quot;),
                    variables  = c(&quot;quantity&quot;,&quot;quantity&quot;,&quot;quantity&quot;,&quot;quantity&quot;,&quot;quantity&quot;,&quot;quantity&quot;,&quot;price&quot;,&quot;price&quot;,&quot;price&quot;,&quot;price&quot;,&quot;price&quot;,&quot;price&quot;,&quot;quality&quot;,&quot;quality&quot;,&quot;quality&quot;,&quot;quality&quot;,&quot;quality&quot;,&quot;quality&quot;,&quot;size&quot;,&quot;size&quot;,&quot;size&quot;,&quot;size&quot;,&quot;size&quot;,&quot;size&quot;),
                     values = round(runif(24, 5.0, 7.5),2)
                   )  
  </code></pre>
  <p>UI:</p>
  <pre><code>ui &lt;- fluidPage(
    headerPanel(
      h1(&quot;Combinacao de atributos&quot;)
    ),
    sidebarPanel(
      selectInput(&quot;xcol&quot;,&quot; Variavel X&quot;, unique(est_popai$variable),
                  selected = 'price'),
      selectInput(&quot;ycol&quot;,&quot; Variavel y&quot;, unique(est_popai$variable),
                  selected = 'size')
    ),
    mainPanel(
      plotOutput(&quot;plot1&quot;) 
    )
  )
  </code></pre>
  <p>Server:</p>
  <pre><code>server &lt;- function(input, output) {
    
    selectData &lt;- reactive  ({
      
      est_popai[est_popai$variable == input$xcol | est_popai$variable == input$ycol,] %&gt;%
        unique() %&gt;%
        spread(variable,value)  
    })
    
    
    output$plot1 &lt;- renderPlot({
      ggplot(data = selectData, aes(x = input$xcol, y = input$ycol)) +
        geom_point()
    })
    
    
  }
  </code></pre>
  <p>Run:</p>
  <pre><code>shinyApp(ui = ui, server = server)
  </code></pre>
  <p>When I run the whole code i got this error message:</p>
  <blockquote>
  <p>Warning: Error in : <code>data</code> must be a data frame, or other object
  coercible by <code>fortify()</code>, not an S3 object with class
  reactiveExpr/reactive   [No stack trace available]</p>
  </blockquote>
  <p>I've tried to add <code>as.data.frame()</code> function with no success. Someone could help me to solve this erro, I've been searching a while.</p>