Now I do not want a scatterplot that corresponds for example the value to the price, I want just the value plotted, in descending order. The points would be (1,80), (2,75), (3,60), (4,50), (5,30). I then would like the color of the points changed depending on the type of fruit.
The coloring can be done with the examples in
for example, however, how do I plot just the one variable? I would like to avoid adding an artifical variable to my dataframe.
Thank you for your answer. That is not quite what I am after, the points created basically are (Banana, 80), (Apple, 75), (Apple, 60), (Banana, 50) and (Apple, 30), not (1,80), (2,75), (3,60), (4,50), (5,30) and a different color encoding which one is a banana or apple.
I am not sure what you mean. The new data frame Fruits_sorted has a new variable but Fruits is unchanged. If you want to avoid the new data frame, just put all the steps in one pipe (I took Matthais' suggestion and used the rank() function from base R):