After numerous attempts, I found myself unable to achieve success. The structure of my data frame is quite straightforward:
df <- as.data.frame(matrix(c("g","d","a","b","z",5,4,3,2,1),5,2))
library("plotly")
p <- plot_ly(data = df,x = ~V1,y = ~V2,type = "scatter",mode = "lines+markers") %>%
layout(title = "my title")
p
This results in:
However, I am looking to maintain the original order on the x-axis without it being sorted alphabetically, and instead display a decreasing graph.