Class Central is learner-supported. When you buy through links on our site, we may earn an affiliate commission.

DataCamp

Manipulating Time Series Data in R

via DataCamp

Overview

Master time series data manipulation in R, including importing, summarizing and subsetting, with zoo, lubridate and xts.


Working with data that changes over time is an essential skill in data science. In this course, you'll learn the foundations of what a time series represents, how to retrieve summary statistics and trends about the data in a time series, and how to interpret a time series visually. You'll cover window functions to focus on a particular period of interest and learn methods of 'imputing' your data – filling in missing values with constant fill, LOCF, or linear interpolation methods.

Syllabus

  • What Is Time Series Data?
    • You'll learn the foundations of what a time series represents, how to retrieve summary statistics about the data in a time series, and how to visually interpret a time series plot as part of the exploration step of your analysis. You’ll also cover how to manage date and time information within R objects and ways of incorporating consistent formatting for dates.
  • Manipulating Time Series with zoo
    • Here, you’ll learn to retrieve key attributes of time series information, such as the range in time of the data and how often the data were sampled, to understand your data better. You'll also be introduced to the zoo package, which contains tools and functions for creating and manipulating time series objects. Many data science applications in R use the data frame paradigm; you'll learn how to convert between a data frame and a time series.
  • Indexing Time Series Objects
    • You’ll cover how to subset a window from a time series to focus on a particular period of interest. You’ll see that when working with real-world time series data, the timespan of your dataset may cover more information than you need, which can clutter your visualizations. You’ll sample time series data at various rates, such as every minute, hour, month, or year. Further, by aggregating your data, you’ll learn to see the overall trends in the data using the xts package. You'll also learn methods of 'imputing' your data – filling in missing values with constant fill, LOCF, or linear interpolation methods.
  • Rolling and Expanding Windows
    • You’ll learn to create “rolling” windows of a time series that move, or "roll" along with data, making it possible to summarize trends in the data across time, such as the average over success months of observations or the sum over several weeks of sales. Overall summary statistics, like mean, median, sum, maximum, and so on, do not always provide insight into how data changes over time, and rolling windows will allow you to compute statistics dynamically. In addition to rolling windows, you will also learn how to create expanding windows, which show how these summary statistics approach their final value.

Taught by

Harrison Brown

Reviews

Start your review of Manipulating Time Series Data in R

Never Stop Learning.

Get personalized course recommendations, track subjects and courses with reminders, and more.

Someone learning on their laptop while sitting on the floor.