Skip to content

Commit

Permalink
Fix warning when using weight with stat_bin (#1921)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jean-Olivier Irisson authored and hadley committed Jan 24, 2017
1 parent 12fb499 commit 721c2f1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

* Fix usage of `structure(NULL)` for R-devel compatibility (#1968).

* Fix warning when using the `weight` aesthetic with `stat_bin()` (through
`geom_histogram()` in particular) (@jiho, #1921).

# ggplot2 2.2.0

## Major new features
Expand Down
2 changes: 1 addition & 1 deletion R/stat-bin.r
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ StatBin <- ggproto("StatBin", Stat,
bin_vector(data$x, bins, weight = data$weight, pad = pad)
},

default_aes = aes(y = ..count..),
default_aes = aes(y = ..count.., weight = 1),
required_aes = c("x")
)

0 comments on commit 721c2f1

Please sign in to comment.