pretty_dates | R Documentation |
pretty_dates()
identifies which unit of time the sub-intervals should be
measured in to provide approximately n breaks, then chooses a "pretty"
length for the sub-intervals and sets start and end points that 1) span the
entire range of the data, and 2) allow the breaks to occur on important
date-times (i.e. on the hour, on the first of the month, etc.)
pretty_dates(x, n, ...)
x |
a vector of POSIXct, POSIXlt, Date, or chron date-time objects |
n |
integer value of the desired number of breaks |
... |
additional arguments to pass to function |
a vector of date-times that can be used as axis tick marks or bin breaks
x <- seq.Date(as.Date("2009-08-02"), by = "year", length.out = 2)
pretty_dates(x, 12)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.