I have a framework with two columns xand y, each of which contains values from 0 to 100 (data is paired). I want to match them with each other using square scatterplots. If I used a regular scatter plot, this would be easy to do:
geom_point(aes(x=x, y=y))
but instead I would like to bin points in N bins from 0 to 100, get the average value xin each box and the average value yfor the points in this bin and show that, as a scatter plot, the mean values, and not the original data points, correlate.
Is there a smart / quick way to do this in ggplot2 using some combination of geom_smooth()and geom_point? Or should it be pre-computed manually and then built?
source
share