ddate_breaks: Work out breaks for an axis of decimal dates

View source: R/hacks.R

ddate_breaksR Documentation

Work out breaks for an axis of decimal dates

Description

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).

Usage

ddate_breaks(x)

Arguments

x

the range over which the dates should be calculated

Details

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.


bbcuffer/rcutils documentation built on Nov. 10, 2023, 12:08 p.m.