I have a (tight) data set consisting of 5 groups, so my data.frame looks like x, y, group. I can build this data and color the points based on their group using:
p= ggplot(dataset, aes(x,y)) p = p + geom_point(aes(colour = group))
Now my problem is that I want to control which group is on top. At the moment, it looks like this is a random solution (at least it seems I canβt figure out what makes something a βtopβ point). Is there any way in ggplot2 to tell geom_point what the order of the points should be?
source share