title: my ggplot does not appear using R shiny
body: <p>I don't know why my ggplot does not appear when I run my app. It appears using plot, it works. But using ggplot, nothing appears. No graph! I tried with <code>print()</code> and without it, no result.</p>
  
  <p>My app I import an csv file and from it I plot a graph.
  Could you help me, please?</p>
  
  <p># Server</p>
  
  <pre><code>server &lt;- function(input, output, session) {
    # added "session" because updateSelectInput requires it
  
    data &lt;- reactive({
      req(input$file1) # require that the input is available
  
      df &lt;- read.csv(input$file1$datapath,
                         header = input$header,
                         sep = input$sep,
                         quote = input$quote)
  
  
    updateSelectInput(session, inputId = 'xcol', label = 'X Variable',
                      choices = names(df), selected = names(df)[sapply(df, is.numeric)])
    updateSelectInput(session, inputId = 'ycol', label = 'Y Variable',
                      choices = names(df), selected = names(df)[sapply(df, is.numeric)])
  
    return(df)
  
    })
  
    output$contents &lt;- renderTable({
      data()
    })
  
    output$MyPlot &lt;- renderPlot({
      x &lt;- data()[, c(input$xcol, input$ycol)]
  
     p &lt;- ggplot(x, aes(input$xcol,input$ycol)) 
     p &lt;- p + geom_line() #+ geom_point()
     print(p)
  
  
      # plot(mydata, type = "l",
      #      xlab = input$xcol,
      #      ylab = input$ycol)
    })
  
    # Generate a summary table of the data uploaded
    output$summary &lt;- renderPrint({
      y &lt;- data()
      summary(y)
  
    })
  
  }
  
  # Create Shiny app
  shinyApp( ui = ui, server = server)
  </code></pre>