ComenzarEmpieza gratis

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.

Este ejercicio forma parte del curso

Time Series Analysis in R

Ver curso

Instrucciones del ejercicio

  • 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.

Ejercicio interactivo práctico

Prueba este ejercicio y completa el código de muestra.

# Plot AirPassengers


# View the start and end dates of AirPassengers



# Use time(), deltat(), frequency(), and cycle() with AirPassengers 



Editar y ejecutar código