Skip to content

Commit bb65b8e

Browse files
committed
bring stat_bindot() into the fold
1 parent 11f5a84 commit bb65b8e

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

R/stat-bindot.R

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -77,13 +77,11 @@ StatBindot <- ggproto("StatBindot", Stat,
7777
}
7878

7979
if (method == "histodot") {
80-
closed <- if (right) "right" else "left"
81-
if (!is.null(binwidth)) {
82-
bins <- bin_breaks_width(range, binwidth, boundary = origin, closed = closed)
83-
} else {
84-
bins <- bin_breaks_bins(range, 30, boundary = origin, closed = closed)
85-
}
86-
80+
bins <- compute_bins(
81+
values, scales[[binaxis]],
82+
breaks = NULL, binwidth = binwidth, bins = 30, center = NULL,
83+
boundary = origin, closed = if (right) "right" else "left"
84+
)
8785
data <- bin_vector(values, bins, weight = data$weight, pad = FALSE)
8886

8987
# Change "width" column to "binwidth" for consistency

0 commit comments

Comments
 (0)