R Programming in Data Science: Dates and Times
2h 18mIntermediate2019-07-24
Authors

Mark Niemann-Ross
Technologist experienced in hardware, software, and science fiction
Course details
One of the fundamental difficulties of data science is working with dates and times. This course shows data engineers, DevOps practitioners, and data-science programmers the most common (and many not so common!) problems and how to use R-based tools to implement solutions. Learn how dates and times are stored and retrieved in base R. Find out how to format, compare, add and subtract, and extract dates and times using built-in R functions. Then discover how to incorporate specialized R packages, such as lubridate, busdater, zoo, timelineR, anytime, datetime, and more, to perform some of the heavy lifting. Instructor Mark Niemann-Ross walks you through each package, so you can appreciate the advantages and best uses of each one.
Learning objectives
Choosing the right tool
Dates and times in base R
Dealing with time zones
Adding and subtracting dates and times
Formatting dates and times
Rounding dates and times
Using lubridate for dates and times
Business and finance packages for R
Working with time-series data
Specialized data and time packages
Learning objectives
Choosing the right tool
Dates and times in base R
Dealing with time zones
Adding and subtracting dates and times
Formatting dates and times
Rounding dates and times
Using lubridate for dates and times
Business and finance packages for R
Working with time-series data
Specialized data and time packages
Skills covered
RStudioRStatisticsData Science FoundationsProgramming LanguagesData ScienceOpen SourceSoftware DevelopmentDeep Dive (X:Y)
Concepts
0. Introduction
- 01 - Calculating times and dates with R
- 02 - Course organization
1. Why Are Dates and Times in R Confusing
- 03 - Typical date calculations
- 04 - How dates and times are stored in R
- 05 - Choose the right date and time tool
2. Dates and Times in Base R
- 06 - The base R Date class
- 07 - Use formatters to recognize dates in character strings
- 08 - Dealing with time zones and daylight savings time
- 09 - Use operators to compare date objects
- 10 - Adding and subtracting dates and times
- 11 - Create sequences of dates, cut dates, and round dates
- 12 - Extract parts of a date
- 13 - Presenting formatted dates and times
- 14 - Use read.csv() to import CSV date information
3. Lubridate and the Tidyverse
- 15 - Advantages of the Lubridate package
- 16 - Parsing date and time with Lubridate
- 17 - Getting and setting time components with Lubridate
- 18 - Rounding dates and time with Lubridate
- 19 - Lubridate math with durations
- 20 - Lubridate math with periods
- 21 - Lubridate math with intervals
- 22 - Time zones with Lubridate
4. Dates and Times for Business and Finance
- 23 - The busdater package
- 24 - The BusinessDuration package
- 25 - The fmdates package
5. Working with Time-Series Data
- 26 - Time-series data
- 27 - The base R ts class
- 28 - The zoo package
- 29 - The xts package
- 30 - The tsibble and tibbletime packages
- 31 - Time-series rolling statistics
- 32 - Time-series graphics
- 33 - The timelineR package
- 34 - The timelineS package
- 35 - The CRAN task view for time-series analysis
6. Specialized Date and Time Packages
- 36 - The anytime package
- 37 - The hms package
- 38 - The mondate package
- 39 - The datetime package
- 40 - The datetimeutils package
- 41 - The padr package
Conclusion
- 42 - Next steps
Related courses
- Code Clinic: R
- R Programming in Data Science: Setup and Start
- R Programming in Data Science: High Volume Data
- R Programming in Data Science: High Velocity Data
- R Programming in Data Science: High Variety Data
- Data Visualization in R with ggplot2
- Coding Exercises: R Data Science
- R Code Challenges: Data Science
Related learn paths
- Advance Your Skills in R
- Advance Your Data Skills in Apache Spark
- Moving from Data Analyst to Data Scientist
- Getting Started with R for Data Science
- Advance Your Skills as an R Expert
- Introduction to Fundamental Skills for Data Work: Data Analysis and Interpretation
- Master Advanced Excel Data & Analytics Skills
- Moving from Data Scientist to Data Analyst