ddate_breaks | R Documentation |
gganimate can't zoom across dates. So, if zooming, a chart will need to be based on decimal dates (e.g. 2022.01, 2022.7).
ddate_breaks(x)
x |
the range over which the dates should be calculated |
That causes problems for picking sensible dates for breaks (e.g. why prefer Jan 1 over Jan 6 when they're decimals?) This function calculates those breaks.
The break width changes depends on the width of the data. Rather than using R's pretty algorithm, it manually specifies whether it's month, year etc.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.