Time Series with data.table in R
Master time series data using data.table in R.
Start Course for Free4 Hours14 Videos52 Exercises2,863 Learners4200 XP
Create Your Free Account
or
By continuing, you accept our Terms of Use, our Privacy Policy and that your data is stored in the USA. You confirm you are at least 16 years old (13 if you are an authorized Classrooms user).Loved by learners at thousands of companies
Course Description
Time series data is fun, but challenging. When ordering matters, your datasets get large, and timestamp precision differences can foil your merges, building reliable data processing pipelines requires a principled approach with the right tools. Enter data.table! Its expressive syntax will make your code powerful without sacrificing readability and its support for in-place operations will make your code super fast. Learn how to master time series data in data.table with this course!
- 1
Review of data.table
FreeThis chapter provides an overview of all the cool things that make data.table perfect for working with time series data, including its multiple column-selection options, how to modify data.tables by reference, and calling functions by taking advantage of non-standard evaluation.
Getting started50 xpSubsetting with .SD100 xpSubsetting with grep()100 xpFlexible data selection50 xpIndividual column names100 xpFunctions that modify the data.table100 xpAdapting to different input columns100 xpIn-place name changes100 xpExecuting functions inside data.tables50 xpExecuting functions inside []100 xpApplying a function over every column100 xpGenerating correlation matrices100 xp - 2
Getting time series data into data.table
Ok, so you have some time series data and you believe me that data.table is great for it. Before you can test that, you need to convert your data! In this chapter, you'll learn how to convert from popular time series data formats into data.table.
Overview of the POSIXct type50 xpUnderstanding POSIXct50 xpCreating POSIXct objects100 xpCreating dates with lubridate100 xpCreating data.tables from vectors50 xpUsing seq.POSIXt()100 xpCreating sample data with .N100 xpCoercing from xts50 xpBrief overview of xts100 xpWhy does anyone use xts for time series data?100 xpConverting xts objects to data.tables100 xpCombining datasets with merge() and rbindlist()50 xpMerging on timestamp100 xpMerging across different frequencies100 xpUsing rbindlist()50 xp - 3
Generating lags, differences, and windowed aggregations
Like most other data, time series data you find in the wild are rarely suitable to directly start using in model training. In this chapter, you'll learn how to write powerful, expressive data.table code to implement a few common forms of time series feature engineering.
Generating lags50 xpLags with setorder and shift100 xpBucketed lags with by100 xpFitting linear models with lags100 xpKnowledge check: lags50 xpGenerating growth rates and differences50 xpFirst differences100 xpGrowth rates100 xpKnowledge check: differences50 xpWindowing with j and by50 xpGrouping data into windows with j and by100 xpWindowed aggregations100 xpKnowledge check: windowed aggregations50 xp - 4
Case study: financial data
It's time to put it all together! In this chapter you'll consider a real-world dataset of spot metal prices from the London Metal Exchange (LME). By the end, you'll know how to write reusable functions to perform common time series feature engineering tasks and you'll have experience using those functions to build a statistical model.
Case study: modeling metals prices50 xpCleaning up column names100 xpPipeline function to merge datasets100 xpTimeseries feature engineering50 xpGenerating and tagging differences100 xpGenerating and tagging growth rates100 xpKnowledge check: growth rates50 xpEDA and model building50 xpA safer function to generate correlation matrices100 xpAdding features100 xpFitting a linear model100 xpCongratulations50 xp
Prerequisites
Data Manipulation with data.table in R
James Lamb
Staff Data Scientist, Uptake
James is a data scientist / engineer based in Chicago, IL. He wrote "Time Series with data.table in R
" on DataCamp but isn't actively maintaining it.
What do other learners have to say?
I've used other sites—Coursera, Udacity, things like that—but DataCamp's been the one that I've stuck with.
Devon Edwards Joseph
Lloyds Banking Group
DataCamp is the top resource I recommend for learning data science.
Louis Maiden
Harvard Business School
DataCamp is by far my favorite website to learn from.
Ronald Bowers
Decision Science Analytics, USAA
Join over 9 million learners and start Time Series with data.table in R today!
Create Your Free Account
or
By continuing, you accept our Terms of Use, our Privacy Policy and that your data is stored in the USA. You confirm you are at least 16 years old (13 if you are an authorized Classrooms user).