Skip to content

Remove binwidth entirely from geom_bar() #3819

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 12, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 0 additions & 12 deletions R/geom-bar.r
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,6 @@
#' rare event that this fails it can be given explicitly by setting `orientation`
#' to either `"x"` or `"y"`. See the *Orientation* section for more detail.
#' @param width Bar width. By default, set to 90% of the resolution of the data.
#' @param binwidth `geom_bar()` no longer has a binwidth argument---if
#' you use it you'll get a warning telling to you use
#' [geom_histogram()] instead.
#' @param geom,stat Override the default connection between `geom_bar()` and
#' `stat_count()`.
#' @examples
Expand Down Expand Up @@ -87,19 +84,10 @@ geom_bar <- function(mapping = NULL, data = NULL,
stat = "count", position = "stack",
...,
width = NULL,
binwidth = NULL,
na.rm = FALSE,
orientation = NA,
show.legend = NA,
inherit.aes = TRUE) {

if (!is.null(binwidth)) {
warn("`geom_bar()` no longer has a `binwidth` parameter. Please use `geom_histogram()` instead.")
return(geom_histogram(mapping = mapping, data = data,
position = position, width = width, binwidth = binwidth, ...,
na.rm = na.rm, show.legend = show.legend, inherit.aes = inherit.aes))
}

layer(
data = data,
mapping = mapping,
Expand Down
5 changes: 0 additions & 5 deletions man/geom_bar.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.