Permalink
Browse files

Update stat_bin message

  • Loading branch information...
1 parent cf89ea4 commit 50639e551b17bf222eeb6fcb0320f6ef42655d0b @wch wch committed Sep 25, 2012
Showing with 7 additions and 10 deletions.
  1. +1 −1 R/geom-bar-.r
  2. +6 −9 R/stat-bin.r
View
@@ -9,7 +9,7 @@
#' example.
#'
#' The heights of the bars commonly represent one of two things: either a
-#' count of cases in each group, the values in a column of the data frame.
+#' count of cases in each group, or the values in a column of the data frame.
#' 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
View
@@ -57,15 +57,12 @@ StatBin <- proto(Stat, {
calculate_groups <- function(., data, ...) {
if (!is.null(data$y) || !is.null(match.call()$y)) {
# Deprecate this behavior
- message("Mapping a variable to y and also using stat=\"bin\". ",
- "With stat=\"bin\", it will attempt to set the y value to the count ",
- "of cases in each group. ",
- "This can result in unexpected behavior and will not be allowed in a ",
- "future version of ggplot2. ",
- "If you want y to represent counts of cases, use stat=\"bin\" and ",
- "don't map a variable to y. ",
- "If you want y to represent values in the data, use ",
- "stat=\"identity\". See ?geom_bar for examples.")
+ message("Mapping a variable to y and also using stat=\"bin\".\n",
+ " With stat=\"bin\", it will attempt to set the y value to the count of cases in each group.\n",
+ " This can result in unexpected behavior and will not be allowed in a future version of ggplot2.\n",
+ " If you want y to represent counts of cases, use stat=\"bin\" and don't map a variable to y.\n",
+ " If you want y to represent values in the data, use stat=\"identity\".\n",
+ " See ?geom_bar for examples.")
}
.$informed <- FALSE

0 comments on commit 50639e5

Please sign in to comment.