Description Usage Arguments Value Examples
Plot the mean of y over the mean of x within bins of x.
1 2 3 4 5 6 7 8 9 10 11 
mapping 
Set of aesthetic mappings created by 
data 
The data to be displayed in this layer. There are three options: If A A 
geom 
The geometric object to use display the data 
position 
Position adjustment, either as a string, or the result of a call to a position adjustment function. 
show.legend 
logical. Should this layer be included in the legends?

inherit.aes 
If 
na.rm 
If 
n 
number of xbins. Default to 20. Set to zero if you want to use distinct value of x for grouping. 
... 
Other arguments passed on to 
a data.frame with additional columns:
xtile 
bins for x 
x 
mean of x 
y 
mean of y 
1 2 3 4 5  library(ggplot2)
g < ggplot(iris, aes(x = Sepal.Width , y = Sepal.Length)) + stat_binmean(n = 10)
g + stat_smooth(method = "lm", se = FALSE)
ggplot(iris, aes(x = Sepal.Width , y = Sepal.Length, color = Species)) + stat_binmean(n = 10)
ggplot(iris, aes(x = Sepal.Width, y = Sepal.Length, weight = Petal.Length)) + stat_binmean(n = 10)

Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.