|
12 | 12 | #' @param origin Origin of first bin |
13 | 13 | #' @param width Width of bars when used with categorical data |
14 | 14 | #' @param right If \code{TRUE}, right-closed, left-open, if \code{FALSE}, |
15 | | -#" the default, right-open, left-closed. |
| 15 | +#' the default, right-open, left-closed. |
16 | 16 | #' @param drop If TRUE, remove all bins with zero counts |
17 | 17 | #' @return New data frame with additional columns: |
18 | 18 | #' \item{count}{number of points in bin} |
|
24 | 24 | #' \donttest{ |
25 | 25 | #' simple <- data.frame(x = rep(1:10, each = 2)) |
26 | 26 | #' base <- ggplot(simple, aes(x)) |
27 | | -#' # By default, right = TRUE, and intervals are of the form (a, b] |
28 | | -#' base + stat_bin(binwidth = 1, drop = FALSE, right = TRUE, col = "black") |
29 | | -#' # If right = FALSE intervals are of the form [a, b) |
| 27 | +#' # By default, right = FALSE intervals are of the form [a, b) |
30 | 28 | #' base + stat_bin(binwidth = 1, drop = FALSE, right = FALSE, col = "black") |
| 29 | +#' # If right = TRUE, and intervals are of the form (a, b] |
| 30 | +#' base + stat_bin(binwidth = 1, drop = FALSE, right = TRUE, col = "black") |
31 | 31 | #' |
32 | 32 | #' m <- ggplot(movies, aes(x=rating)) |
33 | 33 | #' m + stat_bin() |
|
0 commit comments