|
15 | 15 | #' - A function that takes the limits as input and returns breaks as output
|
16 | 16 | #' @param date_breaks A string giving the distance between breaks like "2
|
17 | 17 | #' weeks", or "10 years". If both `breaks` and `date_breaks` are
|
18 |
| -#' specified, `date_breaks` wins. |
| 18 | +#' specified, `date_breaks` wins. Valid specifications are 'sec', 'min', |
| 19 | +#' 'hour', 'day', 'week', 'month' or 'year', optionally followed by 's'. |
19 | 20 | #' @param date_minor_breaks A string giving the distance between minor breaks
|
20 | 21 | #' like "2 weeks", or "10 years". If both `minor_breaks` and
|
21 |
| -#' `date_minor_breaks` are specified, `date_minor_breaks` wins. |
| 22 | +#' `date_minor_breaks` are specified, `date_minor_breaks` wins. Valid |
| 23 | +#' specifications are 'sec', 'min', 'hour', 'day', 'week', 'month' or 'year', |
| 24 | +#' optionally followed by 's'. |
22 | 25 | #' @param minor_breaks One of:
|
23 | 26 | #' - `NULL` for no breaks
|
24 | 27 | #' - `waiver()` for the breaks specified by `date_minor_breaks`
|
@@ -282,14 +285,14 @@ datetime_scale <- function(aesthetics, trans, palette,
|
282 | 285 |
|
283 | 286 |
|
284 | 287 | # Backward compatibility
|
285 |
| - if (is.character(breaks)) breaks <- date_breaks(breaks) |
286 |
| - if (is.character(minor_breaks)) minor_breaks <- date_breaks(minor_breaks) |
| 288 | + if (is.character(breaks)) breaks <- breaks_width(breaks) |
| 289 | + if (is.character(minor_breaks)) minor_breaks <- breaks_width(minor_breaks) |
287 | 290 |
|
288 | 291 | if (!is.waive(date_breaks)) {
|
289 |
| - breaks <- date_breaks(date_breaks) |
| 292 | + breaks <- breaks_width(date_breaks) |
290 | 293 | }
|
291 | 294 | if (!is.waive(date_minor_breaks)) {
|
292 |
| - minor_breaks <- date_breaks(date_minor_breaks) |
| 295 | + minor_breaks <- breaks_width(date_minor_breaks) |
293 | 296 | }
|
294 | 297 | if (!is.waive(date_labels)) {
|
295 | 298 | labels <- function(self, x) {
|
|
0 commit comments