facet_wrap in shiny app
<p>I'm new to <code>shiny</code>. I want to make a <code>shiny</code> app that enables the user to upload a csv file then plot the data.</p>

<p>You can download <a href="https://www.dropbox.com/s/t3q2eayogbe0bgl/shiny_data.csv?dl=0" rel="nofollow noreferrer"><strong>the data from here</strong></a>. </p>

<p>I made it as below</p>

<pre><code>library(shiny)
library(ggplot2)
#ui.R
ui &lt;- fluidPage(
  titlePanel("My shiny app"), sidebarLayout(
sidebarPanel(
  helpText("Blah blah blah"),
  a("Data to be plotted", href="https://www.dropbox.com/s/t3q2eayogbe0bgl/shiny_data.csv?dl=0"),
  tags$hr(),
  fileInput("file","Upload the file"), 
  h5(helpText("Select the read.table parameters below")),
  checkboxInput(inputId = 'header', label = 'Header', value = TRUE),
  checkboxInput(inputId = "stringAsFactors", "stringAsFactors", FALSE),
  br(),
  radioButtons(inputId = 'sep', label = 'Separator', choices = c(Comma=',',Semicolon=';',Tab='\t', Space=''), selected = ',')
),
mainPanel(
  uiOutput("tb"),
  plotOutput("line")             
)
)
)

#server.R
server &lt;- function(input,output){
data &lt;- reactive({


file1 &lt;- input$file
if(is.null(file1)){return()} 

read.table(file=file1$datapath, sep=input$sep, header = input$header, stringsAsFactors = input$stringAsFactors)})

output$filedf &lt;- renderTable({
if(is.null(data())){return ()}
input$file
}) 

output$sum &lt;- renderTable({
if(is.null(data())){return ()}
summary(data())
})

output$table &lt;- renderTable({
if(is.null(data())){return ()}
data()
})

output$line &lt;- renderPlot({
if (is.null(data())) { return() }
print(ggplot(data(), aes(x=date, y=aa)) + geom_line()+ facet_wrap(~station)) })

output$tb &lt;- renderUI({if(is.null(data()))
h5()               
else
  tabsetPanel(tabPanel("About file", tableOutput("filedf")),tabPanel("Data", tableOutput("table")),tabPanel("Summary", tableOutput("sum")))
})
}


shinyApp(ui = ui, server = server)
</code></pre>

<p>The app partially worked. I can upload a csv file but the plot appears empty when I use <code>facet_wrap</code>. Any suggestion how to get the plot after uploading the data for the three stations would be appreciated.</p>