Closed
Description
datetime_scales
accepts any argument type for date_breaks
and date_minor_breaks
, but the parameter documentation claims it only accepts character strings. It's somewhat easy to accidentally supply custom date breaks using scales::breaks_width
to the wrong parameter (date_breaks
instead of breaks
), after all, you're defining date-breaks either way.
I expected an error that the date_breaks parameter had the wrong type, instead I got the unhelpful: Error in strsplit(unitspec, " ") : non-character argument
.
ggplot(economics, aes(date, unemploy)) +
geom_line() +
scale_x_date(date_breaks = scales::breaks_width('10 years', offset = '6 months')