File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -330,19 +330,22 @@ GuideBins <- ggproto(
330
330
331
331
parse_binned_breaks <- function (scale , breaks = scale $ get_breaks()) {
332
332
333
- breaks <- breaks [! is.na(breaks )]
333
+ if (is.waive(scale $ labels ) || is.function(scale $ labels )) {
334
+ breaks <- breaks [! is.na(breaks )]
335
+ }
334
336
if (length(breaks ) == 0 ) {
335
337
return (NULL )
336
338
}
337
339
338
340
if (is.numeric(breaks )) {
339
- breaks <- sort(breaks )
340
341
limits <- scale $ get_limits()
341
342
if (! is.numeric(scale $ breaks )) {
342
- breaks <- breaks [ ! breaks %in% limits ]
343
+ breaks [ breaks %in% limits ] <- NA
343
344
}
344
- breaks <- oob_discard (breaks , limits )
345
+ breaks <- oob_censor (breaks , limits )
345
346
all_breaks <- unique0(c(limits [1 ], breaks , limits [2 ]))
347
+ # Sorting drops NAs on purpose here
348
+ all_breaks <- sort(all_breaks , na.last = NA )
346
349
bin_at <- all_breaks [- 1 ] - diff(all_breaks ) / 2
347
350
} else {
348
351
bin_at <- breaks
You can’t perform that action at this time.
0 commit comments