1.16 lubridate - Tidy Data

Why is Time So Hard?

People assume that time is a strict progression of cause to effect, but actually, from a non-linear, non-subjective viewpoint it's more like a big ball of wibbly-wobbly timey-wimey stuff. Shows a gif of David Tennant (the 10th doctor who) making a ball gesture with his hands.

A spiralling set of roman numerals with a tardis flying out of the middle, and then flying into another similar spiral next to the original.

Physical phenomena

A gif of a spinning earth

  • Rotation of the Earth
  • Earth’s orbit around the sun
  • Lunar orbit around Earth (for some calendars)

Geopolitical phenomena

Computer Specifications

Data Types

  1. A date (<date>)
  2. A time (<time>)
  3. A date-time (<dttm>) a date plus time.
  4. A date-time with a time zone/locale (<POSIXct>)

Can be built from

  • Strings
    "09/10/2010", "2026-08-07", "01.01.1970 00:00:00"
  • Existing date/time objects
    ymd("2026-10-05") + hours(12) + minutes(30)
  • Date-time components (year = 1990, month = 12, day = 4)

A gif from Only Murders in the Building featuring a man in a track suit saying 'Good Times'.

Lubridate

The lubridate cheat sheet from posit, with certain sections highlighted showcasing the importance of functions such as ymd_hms, ymd, mdy, now, and today.

Lubridate

The lubridate cheat sheet from posit, with certain sections highlighted showcasing the importance of periods (events that happen at specific clock times) and durations (physical processes, modeled as seconds).