The ts object
The core R package datasets
contains lot of datasets that are essentially time series data: AirPassengers
, BJsales
, EuStockMarkets
, JohnsonJohnson
, LakeHuron
, Nile
, UKgas
, UKDriverDeaths
, UKLungDeaths
, USAccDeaths
, WWWusage
, airmiles
, austres
, co2
, discoveries
, lynx
, nhtemp
, nottem
, presidents
, treering
, gas
, uspop
, and sunspots
. The AirPassengers
data is one of the most popular datasets and it is used as a benchmark dataset. The data can be loaded in an R session with data(mydata)
and its class can be verified as time series as follows:
data (JohnsonJohnson) class (JohnsonJohnson) ## [1] "ts" JohnsonJohnson ## Qtr1 Qtr2 Qtr3 Qtr4 ## 1960 0.71 0.63 0.85 0.44 ## 1961 0.61 0.69 0.92 0.55 ## 1962 0.72 0.77 0.92 0.60 ## 1978 11.88 12.06 12.15 8.91 ## 1979 14.04 12.96 14.85 9.99 ## 1980 16.20 14.67 16.02 11.61 frequency (JohnsonJohnson) ## [1] 4
The JohnsonJohnson
dataset is a time series dataset and it is verified by applying the class function. Details about...