Session Ready
Exercise

Fast parsing with lubridate::fast_strptime

lubridate provides its own fast datetime parser: fast_strptime(). Instead of taking an order argument like parse_date_time() it takes a format argument and the format must comply with the strptime() style.

As you saw in the video that means any character that represents a datetime component must be prefixed with a % and any non-whitespace characters must be explicitly included.

Try parsing dates with fast_strptime() and then compare its speed to the other methods you've seen.

Instructions
100 XP

dates is in your workspace again.

  • Examine the head of dates. What components are present? What separators are used?
  • Parse dates with fast_strptime() by specifying the appropriate format string.
  • Compare the timing of fast_strptime() to fasttime and ymd_hms().