© The Author(s), under exclusive license to APress Media, LLC, part of Springer Nature 2022
T. MailundR 4 Data Science Quick Referencehttps://doi.org/10.1007/978-1-4842-8780-4_11

11. Working with Dates: lubridate

Thomas Mailund1  
(1)
Aarhus, Denmark
 
The lubridate package is essential for working with dates and fits well with the Tidyverse . It is not, however, loaded when you import the tidyverse package, so you need to explicitly load it.
library(lubridate)

Time Points

You can create dates and dates with time -of-day information using variations of the ymd() function. The letters y, m, and d stand for year, month, and day, respectively. With ymd(), you should write your data in a format that puts the year first, the month second, and the day last. ...

Get R 4 Data Science Quick Reference: A Pocket Guide to APIs, Libraries, and Packages now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.