1. Learn
  2. /
  3. Courses
  4. /
  5. Time Series Analysis in R

Connected

Exercise

Identifying the sampling frequency

In addition to viewing your data and plotting over time, there are several additional operations that can be performed on time series datasets.

The start() and end() functions return the time index of the first and last observations, respectively. The time() function calculates a vector of time indices, with one element for each time index on which the series was observed.

The deltat() function returns the fixed time interval between observations and the frequency() function returns the number of observations per unit time. Finally, the cycle() function returns the position in the cycle of each observation.

In this exercise, you'll practice applying these functions to the AirPassengers dataset, which reports the monthly total international airline passengers (in thousands) from 1949 to 1960.

Instructions

100 XP
  • Begin by plotting the AirPassengers data using a simple call to plot().
  • Next, list the first and last time observations in AirPassengers using start() and end(), respectively.
  • Finally, gain some additional insight into this dataset by using the time(), deltat(), frequency(), and cycle() commands AirPassengers.