Machine Learning with R Cookbook - Second Edition
by AshishSingh Bhatia, Yu-Wei, Chiu (David Chiu)
How it works...
The plot function will plot the time series with the time intervals on the x axis and observations on the y values. From the plot, one can see the where things are heading. In the air passenger plot, the number of passengers are steadily increasing. With my_series, the prices go up and down in the given graph. In the year 2014, the prices are at an all-time high. From the plotting, one can make out the trends and get some vital insight.
The cycle function gives the position of the observation in a cycle. The aggregate function splits the data and gives the summary of the subset. In our case, it splits the data into years and presents the total of number of passengers traveling in a year. Plotting the aggregate gives a clearer ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access