ggplot2
ggplot2 copied to clipboard
More flexible `date_breaks` arg or better doc ?
The date_breaks arg is documented as :
date_breaks :
A string giving the distance between breaks like "2 weeks", or "10 years". If both breaks and date_breaks are specified, date_breaks wins.
I tried date_breaks = "15 minutes" and got :
Error in cut.POSIXt(date, time, right = TRUE, include.lowest = TRUE) : invalid specification of 'breaks'
It worked with date_breaks = "15 min" though.
Looking at the code it seems to fall back to cut.POSIXct and we see in the doc the breaks arg described as :
[...] or an interval specification, one of "sec", "min", "hour", "day", "DSTday", "week", "month", "quarter" or "year", optionally preceded by an integer and a space, or followed by "s". (For "Date" objects only interval specifications using "day", "week", "month", "quarter" and "year" are allowed.)
Maybe the doc could mention those (or refer to ?cut.POSIXt) and/or the error could be improved ?