title: R Shiny: not sure why ggplot is failing
body: <p>Shiny newbie here. </p>
  
  <p>I am trying to write a R shiny script, and one of things I want to do is generate a histogram of the number of ad views for a given day and a given advertiser across different regions. </p>
  
  <p>My table is has the following columns (with sample data):  </p>
  
  <pre><code>Date    Impressions Advertiser  Factor 1         DMA
  
  2/19       22789     McDonalds   Cheap           Los Angeles
  2/17       15002    Regal Cinem  Luxury          New York
  2/20       12345     McDonalds   Cheap           D.C.
  </code></pre>
  
  <p>My desired output on the UI tab is something like this with ggplot</p>
  
  <pre><code>ggplot(df2, aes(x=DMA, y=Impressions, fill=DMA)) +geom_histogram()
  </code></pre>
  
  <p>and should looks like this</p>
  
  <p><img src="https://i.stack.imgur.com/oLBMM.png" alt="enter image description here"></p>
  
  <p>However, I am getting an error</p>
  
  <pre><code>Error: object 'DMA' not found
  </code></pre>
  
  <p>when I am basically pasting the same formula into R Shiny. My code is as follows</p>
  
  <p>server.R</p>
  
  <pre><code>library(shiny)
  library(ggplot2)
  
  df&lt;- na.omit(read.csv("data.csv", fill= TRUE, nrows= 3000000))
  
  shinyServer(function(input, output){
  
  df2&lt;- reactive({df[df$Date==input$date &amp; df$Advertiser==input$name, ]})
  
  #FIXME why is this plot not printing
  output$plot1&lt;- renderPlot({
    print(ggplot(df2, aes(x=DMA, y=Impressions, fill=DMA)) +geom_histogram())
  
  })
  #end of server brackets
  })
  </code></pre>
  
  <p>ui.R</p>
  
  <pre><code>library(shiny)
  df&lt;- na.omit(read.csv("data.csv", fill= TRUE, nrows= 3000000))
  daterange&lt;- unique(df$Date)
  names &lt;- unique(df$Advertiser)
  
  shinyUI(pageWithSidebar(
  
    #Title of Application
    headerPanel("Advertisement"), 
  
    sidebarPanel( 
  
      selectInput("date", "Date:", 
                  choices= daterange),
  
      selectInput("name", "Partner", 
                  choices= names)
  
    ),
  
    mainPanel(
      tabsetPanel(
        tabPanel("Plot1", plotOutput("plot1"))
  
        )
      )
  
    #end of UI brackets
    ))
  </code></pre>
  
  <p>Everything else works, including the tabs. But this plot is not showing up. </p>
  
  <p>UPDATE: THANKS, GGplot now works by wrapping the print() statement around it. However, a new issue arises where a variable cannot be found. </p>