0

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 Data, but when I run this in ggplot, it produced non-ordered scattering of the points as you can see here Produced graph I would like to plot the same figure but with the dots being descending order from high to low similar to this one wished Figure

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

stefan
  • 90,330
  • 6
  • 25
  • 51
M. Samir
  • 11
  • 2
  • There are many similar questions on this forum, like https://stackoverflow.com/questions/16961921/plot-data-in-descending-order-as-appears-in-data-frame/16968999#16968999. Does that help? – Jon Spring Sep 21 '22 at 16:40
  • Thanks, but this example is different. Could you help in my example – M. Samir Sep 22 '22 at 09:01

0 Answers0