Session Ready
Exercise

Calculate timespans

As we saw in the video, the first step to calculating a timespan in lubridate is to make an interval, then use division to convert the units to what you want (like weeks(x) or months(x)). The x refers to the number of time units to be included in the period. In this exercise, you'll calculate timespans with the baker_time data we just made.

Instructions 1/3
undefined XP
  • 1
  • 2
  • 3
  • Create a new interval called time_on_air, calculated as the timespan between each baker's first and last date that they appeared in the UK.