title: Plot graph with multiple y axis variable in r
body: <p>I have the following data structure
  <a href="https://i.stack.imgur.com/k0LB9.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/k0LB9.png" alt="enter image description here"></a>
  I have plotted the graph of Date ( x axis) Vs TypeA / TypeB /….<br>
  How can I plot Date (x axis) vs multiple Types (like TypeA , TypeB - 2 lines. One for each).  </p>
  
  <p>The code currently used is   </p>
  
  <pre><code>output$trendPlot1 &lt;- renderPlotly({
      dataset1 &lt;- reactive({
        data3[sample(nrow(data3) , 100 ),]
      })
      p &lt;- ggplot(dataset1(), aes_string(x = "Date", y = input$y )) +
         ggtitle(paste0("Simple Cumulative Return of Stock over Time")) +
        # geom_point()
        geom_line()
      ggplotly(p) %&gt;% 
        layout( autosize=TRUE)
    })
  </code></pre>
  
  <p>y (drop down list with different Types) is inputed by the user on the screen.I will have multiple selection drop down list and will be able to select different Types. (there are around 100 types in actual data). I want to plot only the ones types that are selected by the user and not the rest.<br>
  How can I pass multiple selections to the graph to be plotted on a single graph?</p>