title: Shiny ggplot: dynamic y axis title (multiple columns)
body: <p>I am trying to adjust y axis title to the <code>ggplot</code>. I have choosen <code>selectizeInput</code> widget so the user can choose multiple columns for plotting. I would like the title of y axis to change dynamicaly and display choosen columnn names.</p>
  
  <p>With this simple code:</p>
  
  <pre><code>library(shiny)
  library(DT)
  library(ggplot2)
  library(reshape2)
  
  x &lt;- as.numeric(1:1000000)
  y &lt;- as.numeric(1:1000000)
  z &lt;- as.numeric(1:1000000)
  data &lt;- data.frame(x,y, z)
  
  shinyApp(
    ui = fluidPage(selectizeInput(inputId = "yaxis", 
                               label = "Y-axis",
                               choices = list("x","y","z"), 
                               selected = c("x"), multiple=TRUE),
                   dataTableOutput('tableId'),
                   plotOutput('plot1')),
    server = function(input, output) {    
      output$tableId = renderDataTable({
        datatable(data, options = list(pageLength = 10, lengthMenu=c(10,20,30)))
      })
      output$plot1 = renderPlot({
  
        filtered_data &lt;- data[input$tableId_rows_all,]
  
        widedata &lt;- subset(filtered_data, select=c("x", input$yaxis))
  
        longdata &lt;- melt(widedata, id.vars="x", variable.name="Variables", value.name="Value_y")
  
        ggplot(data=longdata, aes_string(x="x",y="Value_y",group="Variables")) + geom_line() +ylab(paste(input$yaxis))   
      })
    }
  )  
  </code></pre>
  
  <p>It is displaying only the 1st choice...</p>
  
  <p>If i change to:</p>
  
  <pre><code>+ylab(paste(input$yaxis[1],input$yaxis[2]))
  </code></pre>
  
  <p>It displays only two choices, but if only one choice is selected, then on the axis title we will see <strong>NA</strong> in place of the second choice..</p>
  
  <p>I would like it to be dynamic, so user can choose 1 or more choices, where the title of yaxis is going to adjust..</p>
  
  <p>Thanks for help!</p>