Skip to content

Conversation

wch
Copy link
Member

@wch wch commented Aug 20, 2012

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.

It should also have some tests added.

#' By default, \code{geom_bar} uses \code{stat="bin"}. This makes the height
#' of each bar equal to the number of cases in each group, and it is
#' incompatible with mapping values to the \code{y} aesthetic. If you want
#' the heights of the bars to be represent values in the data, use
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove to be?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks, fixed.

@wch
Copy link
Member Author

wch commented Aug 22, 2012

I've changed the error to a very long warning message. Even though it's really long, I think it is worth keeping, since this is probably a very common issue and it can be confusing.

@wch wch merged commit 70996bc into tidyverse:master Aug 25, 2012
@lock
Copy link

lock bot commented Jan 19, 2019

This old issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with reprex) and link to this issue. https://reprex.tidyverse.org/

@lock lock bot locked and limited conversation to collaborators Jan 19, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add clearer error messages with geom_bar
2 participants