How can I descending reorder the dots in the scatter plot in ggplot based on the X values ?
Dear All,
I am stuck at one trick in ggplot in R: I am trying to plot a scatter plot for metabolites (y axis) based on their VIP score (X axis) here is the data , but when I run this in ggplot, it produced non-ordered scattering of the points as you can see here
I would like to plot the same figure but with the dots being descending order from high to low similar to this one
I have tried using reorder but could not get my head around it. Here is my script
ggplot(VIP, aes(x= `Mean decrease in model accuracy`, y = Metabolites, color = Class)) + geom_point(size = 3)
HIghly appreciating for any help
Thanks
• 2,500 views
•
link
1 answer
Log in to answer this question.