title: Plot.ly in R: Unwanted alphabetical sorting of x-axis
body: <p>I tried for hours, but I could not succeed. My data frame is simply</p>
  
  <pre><code>df &lt;- as.data.frame(matrix(c("g","d","a","b","z",5,4,3,2,1),5,2))
  
  library("plotly")
  p &lt;- plot_ly(data = df,x = ~V1,y = ~V2,type = "scatter",mode = "lines+markers") %&gt;%
  layout(title = "my title")
  p
  </code></pre>
  
  <p>So, this give me</p>
  
  <p><img src="https://i.stack.imgur.com/PApKU.png" alt="myplot"></p>
  
  <p>But I don't want x axis to be sorted alphabetically, I just want to keep the order as it is and see a decreasing graph.</p>