hadley/ggplot2 — pull request #648 by wch (2012-08-20 21:17:39+00:00)
Title: Better error messages for stat_bin

This fixes #632. It provides clearer error messages when the user makes a graph with `stat_bin` and also maps something to a `y` value.

A couple notes:

* I'm not sure the error message will be clear to a novice -- someone who uses `geom_bar` might not even realize that they're using `stat="bin"`.
* It might break existing user code that relies on the buggy behavior where you can use `stat="bin"` and map values to y, provided that there's only one y value per group. This could possibly affect a lot of existing code.