Intro to Time Series Analysis -Part 1

June 5, 2018

(This article was first published on R-exercises, and kindly contributed to R-bloggers)

In the exercises below, we will work with Time Series analysis and see how R can make your life easier when working with Time Series.

doing Time Series Analysis.This will be a series of Exercises and I urge you to take it in series
Please install the package and load the library before starting
Answers to these exercises are available here.

Exercise 1

Install Forecast package ,1st step in any analysis is to see the data , use autoplot to plot the gold data set

available in forecast package .

Exercise 2
Find the outlier in the gold data .Find how far its from the median

Exercise 3

use ggseasonalplot to plot the gas data . See how each year stack with each other

Exercise 4

Now I want to plot the gas data for year 1990 and after .How do I achieve that .
Exercise 5

ggseasonalplot can be used to see seasonal plots as polar coordinates , plot the same data as above but use

polar coordinates instead .

Exercise 6
How can I see monthly time series of the gas price
Hint use monthplot or ggsubseriesplot

Exercise 7

For a timeseries ,we can find the dominant frequency of that time series and use it to our analysis .How to

find the frequency of gas data (assume that its a long /big data and you dont have a clue of the frequency)

To leave a comment for the author, please follow the link and comment on their blog: R-exercises. offers daily e-mail updates about R news and tutorials on topics such as: Data science, Big Data, R jobs, visualization (ggplot2, Boxplots, maps, animation), programming (RStudio, Sweave, LaTeX, SQL, Eclipse, git, hadoop, Web Scraping) statistics (regression, PCA, time series, trading) and more...

If you got this far, why not subscribe for updates from the site? Choose your flavor: e-mail, twitter, RSS, or facebook...

Comments are closed.

Search R-bloggers


Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)