title: r plotly chart based on multiple columns
body: <p>I have a df which can have 2 or more columns with the first one <code>month</code> always fixed.I am trying to plot them using plotly r. As of now it has three columns: month,apple,orange. Based on analysis it can have another column banana. Below is the code I am using right now but it even takes the column month for y-axis. How do I fix this:</p>
  
  <pre><code>&gt; sample_test
      month apple orange
  2  Aug-17     2      1
  3  Dec-17     2      1
  4  Feb-18     2      1
  5  Jan-18     2      1
  6  Jul-17     2      1
  7  Jun-17     2      1
  8  May-17     2      1
  9  Nov-17     2      1
  10 Oct-17     2      1
  11 Sep-17     2      1
  
  p&lt;- plot_ly(sample_test, x = sample_test$month,  name = 'alpha', type = 'scatter', mode = 'lines',
              line = list(color = 'rgb(24, 205, 12)', width = 4)) %&gt;% 
    layout(#title = "abbb",
      xaxis = list(title = "Time"),
      yaxis = list (title = "Percentage"))
  
  for(trace in colnames(sample_test)){
    p &lt;- p %&gt;% plotly::add_trace(y = as.formula(paste0("~`", trace, "`")), name = trace)
  }
  p
  </code></pre>
  
  <p>The output looks like this :<a href="https://i.stack.imgur.com/BtHDu.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/BtHDu.png" alt="enter image description here"></a></p>