Skip to content
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
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,7 @@ export(geom_abline)
export(geom_area)
export(geom_bar)
export(geom_bin2d)
export(geom_bin_2d)
export(geom_blank)
export(geom_boxplot)
export(geom_col)
Expand Down
18 changes: 12 additions & 6 deletions R/geom-bin2d.r
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,20 @@
#' @inheritParams layer
#' @inheritParams geom_point
#' @param geom,stat Use to override the default connection between
#' `geom_bin2d()` and `stat_bin2d()`.
#' `geom_bin_2d()` and `stat_bin_2d()`.
#' @seealso [stat_binhex()] for hexagonal binning
#' @examples
#' d <- ggplot(diamonds, aes(x, y)) + xlim(4, 10) + ylim(4, 10)
#' d + geom_bin2d()
#' d + geom_bin_2d()
#'
#' # You can control the size of the bins by specifying the number of
#' # bins in each direction:
#' d + geom_bin2d(bins = 10)
#' d + geom_bin2d(bins = 30)
#' d + geom_bin_2d(bins = 10)
#' d + geom_bin_2d(bins = 30)
#'
#' # Or by specifying the width of the bins
#' d + geom_bin2d(binwidth = c(0.1, 0.1))
geom_bin2d <- function(mapping = NULL, data = NULL,
#' d + geom_bin_2d(binwidth = c(0.1, 0.1))
geom_bin_2d <- function(mapping = NULL, data = NULL,
stat = "bin2d", position = "identity",
...,
na.rm = FALSE,
Expand All @@ -45,3 +45,9 @@ geom_bin2d <- function(mapping = NULL, data = NULL,
)
)
}

#' @export
#' @rdname geom_bin_2d
#' @usage NULL
geom_bin2d <- geom_bin_2d

4 changes: 2 additions & 2 deletions R/stat-bin2d.r
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#' horizontal directions. Overrides `bins` if both set.
#' @param drop if `TRUE` removes all cells with 0 counts.
#' @export
#' @rdname geom_bin2d
#' @rdname geom_bin_2d
#' @section Computed variables:
#' \describe{
#' \item{count}{number of points in bin}
Expand Down Expand Up @@ -41,7 +41,7 @@ stat_bin_2d <- function(mapping = NULL, data = NULL,


#' @export
#' @rdname geom_bin2d
#' @rdname geom_bin_2d
#' @usage NULL
stat_bin2d <- stat_bin_2d

Expand Down
15 changes: 8 additions & 7 deletions man/geom_bin2d.Rd → man/geom_bin_2d.Rd

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