Skip to content

Commit 5319784

Browse files
authored
use geom_bin_2d() just like geom_density_2d() (#4449)
1 parent bb8f960 commit 5319784

File tree

4 files changed

+23
-15
lines changed

4 files changed

+23
-15
lines changed

NAMESPACE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -343,6 +343,7 @@ export(geom_abline)
343343
export(geom_area)
344344
export(geom_bar)
345345
export(geom_bin2d)
346+
export(geom_bin_2d)
346347
export(geom_blank)
347348
export(geom_boxplot)
348349
export(geom_col)

R/geom-bin2d.r

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,20 @@
1111
#' @inheritParams layer
1212
#' @inheritParams geom_point
1313
#' @param geom,stat Use to override the default connection between
14-
#' `geom_bin2d()` and `stat_bin2d()`.
14+
#' `geom_bin_2d()` and `stat_bin_2d()`.
1515
#' @seealso [stat_binhex()] for hexagonal binning
1616
#' @examples
1717
#' d <- ggplot(diamonds, aes(x, y)) + xlim(4, 10) + ylim(4, 10)
18-
#' d + geom_bin2d()
18+
#' d + geom_bin_2d()
1919
#'
2020
#' # You can control the size of the bins by specifying the number of
2121
#' # bins in each direction:
22-
#' d + geom_bin2d(bins = 10)
23-
#' d + geom_bin2d(bins = 30)
22+
#' d + geom_bin_2d(bins = 10)
23+
#' d + geom_bin_2d(bins = 30)
2424
#'
2525
#' # Or by specifying the width of the bins
26-
#' d + geom_bin2d(binwidth = c(0.1, 0.1))
27-
geom_bin2d <- function(mapping = NULL, data = NULL,
26+
#' d + geom_bin_2d(binwidth = c(0.1, 0.1))
27+
geom_bin_2d <- function(mapping = NULL, data = NULL,
2828
stat = "bin2d", position = "identity",
2929
...,
3030
na.rm = FALSE,
@@ -45,3 +45,9 @@ geom_bin2d <- function(mapping = NULL, data = NULL,
4545
)
4646
)
4747
}
48+
49+
#' @export
50+
#' @rdname geom_bin_2d
51+
#' @usage NULL
52+
geom_bin2d <- geom_bin_2d
53+

R/stat-bin2d.r

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#' horizontal directions. Overrides `bins` if both set.
55
#' @param drop if `TRUE` removes all cells with 0 counts.
66
#' @export
7-
#' @rdname geom_bin2d
7+
#' @rdname geom_bin_2d
88
#' @section Computed variables:
99
#' \describe{
1010
#' \item{count}{number of points in bin}
@@ -41,7 +41,7 @@ stat_bin_2d <- function(mapping = NULL, data = NULL,
4141

4242

4343
#' @export
44-
#' @rdname geom_bin2d
44+
#' @rdname geom_bin_2d
4545
#' @usage NULL
4646
stat_bin2d <- stat_bin_2d
4747

man/geom_bin2d.Rd renamed to man/geom_bin_2d.Rd

Lines changed: 8 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)