title: R Shiny unable to display ggplot chart
body: <p>I am having issues displaying <code>ggplot</code> (or any form of charts like <code>hist()</code>). I have tried looking through Stack Overflow but the solutions provided were not useful for this instance. I have not been able to display any of the graphs successfully.</p>
  
  <p>I am using R studio with 3.2.0 build, deploying on <code>Shinyapps.io</code> and viewing via Chrome. I am able to display the graph within R but unable to display it when running with shiny.</p>
  
  <p>Is this a code issue or something I had missed out from my packages? (Note: I have reduced my code trying to troubleshoot, so the variables from <code>ui.R</code> are not used in <code>server.R</code>.)</p>
  
  <p><strong>ui.R</strong></p>
  
  <pre><code>library(shiny)
  library(ggplot2)
  
  dataset &lt;- diamonds
  
  
  diamondcolours &lt;- unique( dataset["color"], incomparables = FALSE)    
  diamondcolours &lt;- lapply(diamondcolours, as.character)
  
  diamondcuts &lt;- unique( dataset["cut"], incomparables = FALSE)    
  diamondcuts &lt;- lapply(diamondcuts, as.character)
  
  diamondclarity &lt;- unique( dataset["clarity"], incomparables = FALSE)    
  diamondclarity &lt;- lapply(diamondclarity, as.character)
  
  carat &lt;- dataset["carat"]
  mincarat &lt;- min(carat[ carat != min(carat) ])
  # mincarat
  maxcarat &lt;- max(carat[ carat != max(carat) ])
  # maxcarat
  
  fluidPage(
  
    titlePanel("Diamonds"),
  
    sidebarPanel(
      sliderInput('carat', 'Carat', min=mincarat, max=maxcarat,
                  value=mincarat, step=0.01, round=0),    
      selectInput('cut', 'Cut', diamondcuts$cut),    
      selectInput('color', 'Color', diamondcolours$color),    
      selectInput('clarity', 'Clarity', diamondclarity$clarity)  
    ),
  
     mainPanel(
      plotOutput(outputId = 'mainplot')
     )
  )
  </code></pre>
  
  <p><strong>server.R</strong></p>
  
  <pre><code>library(shiny)
  library(ggplot2)
  
  
  dataset &lt;- diamonds()
  
    shinyServer(function(input, output, session) {
      values &lt;- reactiveValues()
  
      testset &lt;- dataset[ which(dataset$color == values$dcolor &amp; dataset$carat &gt; values$dcarat &amp; dataset$clarity == values$dclarity &amp; dataset$cut== values$dcut ), ]  
  
  
    output$mainplot &lt;- renderPlot({
  
      p &lt;- ggplot(dataset[dataset$price &lt;= 326,], aes(x = carat, y = color))
      p &lt;- p + geom_point()
      print(p)
  
  }  )
  </code></pre>