Skip to content

Commit d985934

Browse files
committed
fixed #1188
1 parent eb7711b commit d985934

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

R/process_breaks.R

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ fancy_breaks <- function(vec, as.count = FALSE, interval.disjoint = FALSE, inter
1212

1313
args$called = NULL
1414

15+
if (!intervals) {
16+
as.count = FALSE
17+
interval.disjoint = FALSE
18+
}
19+
1520
if (inherits(vec, c("POSIXct", "POSIXlt", "Date"))) {
1621
x = format(vec)
1722
} else if (!is.null(fun) && !interval.disjoint) {
@@ -58,7 +63,7 @@ fancy_breaks <- function(vec, as.count = FALSE, interval.disjoint = FALSE, inter
5863
#update vec_fin
5964
# add 'to' numbers and see if digits should be increased
6065
vec_fin2 = c(vec_fin, vec_fin[-1] - 10^-digits)
61-
while (anyDuplicated(vec_fin2)) {
66+
while (anyDuplicated(na.omit(vec_fin2))) {
6267
digits = digits + 1
6368
vec_fin2 = c(vec_fin, vec_fin[-1] - 10^-digits)
6469
}
@@ -74,6 +79,7 @@ fancy_breaks <- function(vec, as.count = FALSE, interval.disjoint = FALSE, inter
7479
}
7580
}
7681

82+
7783
if ((!is.null(fun) && interval.disjoint)) {
7884
x <- do.call(fun, list(vec))
7985
} else if (!scientific || as.count) {

0 commit comments

Comments
 (0)