Skip to content

Improving documentation for geom_histogram(). #3424

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
Jul 16, 2019
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
6 changes: 4 additions & 2 deletions R/geom-histogram.r
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@
#'
#' By default, the underlying computation (`stat_bin()`) uses 30 bins;
#' this is not a good default, but the idea is to get you experimenting with
#' different bin widths. You may need to look at a few to uncover the full
#' story behind your data.
#' different number of bins. You can also experiment modifying the `binwidth` with
#' `center` or `boundary` arguments. `binwidth` overrides `bins` so you should do
#' one change at a time. You may need to look at a few options to uncover
#' the full story behind your data.
#'
#' @section Aesthetics:
#' `geom_histogram()` uses the same aesthetics as [geom_bar()];
Expand Down
10 changes: 5 additions & 5 deletions R/stat-bin.r
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#' @param binwidth The width of the bins. Can be specified as a numeric value
#' or as a function that calculates width from unscaled x. Here, "unscaled x"
#' refers to the original x values in the data, before application of any
#' or as a function that calculates width from unscaled x. Here, "unscaled x"
#' refers to the original x values in the data, before application of any
#' scale transformation. When specifying a function along with a grouping
#' structure, the function will be called once per group.
#' The default is to use `bins`
#' bins that cover the range of the data. You should always override
Copy link
Member

Choose a reason for hiding this comment

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

I think this might have been intentional, i.e. "The default is to use bins [i.e. the bins parameter] number of bins". Maybe another way to word this would be "The default is to use the number of bins in bins, covering the range of the data"?

#' structure, the function will be called once per group.
#' The default is to use the number of bins in `bins`,
#' covering the range of the data. You should always override
#' this value, exploring multiple widths to find the best to illustrate the
#' stories in your data.
#'
Expand Down
10 changes: 6 additions & 4 deletions man/geom_histogram.Rd

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

4 changes: 2 additions & 2 deletions man/stat_summary.Rd

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