title: Scatterplot in Shiny
body: <p>I am trying to create a scatterplot based on a csv I have loaded however when I run the code I either get no plot showing or an error when I include the aes mapping: "Mapping should be created with <code>aes()</code> or <code>aes_()</code>."</p>
  
  <p>Can anyone give me pointers on where I am going wrong?</p>
  
  <p>Code:</p>
  
  <pre><code>library(shiny)
  library(ggplot2)
  
  ui &lt;- (fluidPage(
  titlePanel("Pig Breeds"),
  sidebarLayout(
  sidebarPanel(
    selectInput(inputId = "x", 
                label = "Pig Breeds:", 
                choices = c("total_pigs", "female_breeding_herd", 
                            "in_pig_sows", "in_pig_gifts", "other_sows", 
                            "maiden_gilts", "boars_for_service", "other_pigs"),
                selected = "total_pigs"),
    selectInput(inputId = "y",
                label = "Year by year change:",
                choices = c(2016, 2017, 2018, "year_on_year_change"),
                selected = 2016),
    actionButton(inputId = "update", label = "update")
              ),
  mainPanel = (
    plotOutput(outputId = "scatterplot")
    )
  )
  )
  )
  
  server &lt;- (function(input, output) {
  output$scatterplot &lt;- renderPlot({
  ggplot(data=(read.csv("eu_pigs.csv")),
              aes(x = output$x, y = output$y) + 
              geom_point())
  observeEvent(input$update, {print(as.numeric(input$update))})
         }
      )
    }
   )
  
  shinyApp(ui, server)
  </code></pre>