I have the following dataframe:
df<-data.frame(ID = c(1,2,3,4,5,6,7,8,9,10),
group = c(1,1,1,1,1,2,2,2,3,3),
level = c(0.1,0.5,0.2,0.3,0.6,0.7,0.8,0.5,0.9,0.3))
I would like to use ggplot2 to plot a scatter plot, where every point (x,y) corresponds to the values of (ID,level). But I want to label the x-axis based on the group value, so that the x-axis in this case would have 3 ticks: under tick "1", there would be 5 points, tick "2" with 3 points and tick "3" with 2 points.



groupdirectly onx. Maybe you could clarify how your plot should look like.groupvalue and the points based on(ID, level)values, so for example under tick "1", the points that are plotted should be: (1, 0.1), (2, 0.5), (3, 0.2), (4, 0.3), (5, 0.6).