Reader small image

You're reading from  Hands-On Time Series Analysis with R

Product typeBook
Published inMay 2019
Reading LevelBeginner
PublisherPackt
ISBN-139781788629157
Edition1st Edition
Languages
Right arrow
Author (1)
Rami Krispin
Rami Krispin
author image
Rami Krispin

Rami Krispin is a data scientist at a major Silicon Valley company, where he focuses on time series analysis and forecasting. In his free time, he also develops open source tools and is the author of several R packages, including the TSstudio package for time series analysis and forecasting applications. Rami holds an MA in Applied Economics and an MS in actuarial mathematics from the University of MichiganAnn Arbor.
Read more about Rami Krispin

Right arrow

The Natural Gas Consumption dataset

In this chapter, and generally throughout this book, we will use the Natural Gas Consumption (NGC) dataset as an example of time series data. This dataset represents the quarterly consumption of natural gas in the US between 2000 and 2018. We will use the Quandl package to load the data from the Federal Reserve Bank of St. Louis database (FRED) and store it as a ts object:

library(Quandl)

NGC <-Quandl(code = "FRED/NATURALGAS",
collapse="quarterly",
type = "ts",
end_date = "2018-12-31")

The class of the output can be defined by the type argument, which, in this case, was set to the ts object:

class(NGC)
## [1] "ts"

Typically, when loading a new dataset, it is recommended that you plot the series before moving to the next step in the analysis. This allows you...

lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Hands-On Time Series Analysis with R
Published in: May 2019Publisher: PacktISBN-13: 9781788629157

Author (1)

author image
Rami Krispin

Rami Krispin is a data scientist at a major Silicon Valley company, where he focuses on time series analysis and forecasting. In his free time, he also develops open source tools and is the author of several R packages, including the TSstudio package for time series analysis and forecasting applications. Rami holds an MA in Applied Economics and an MS in actuarial mathematics from the University of MichiganAnn Arbor.
Read more about Rami Krispin