| Mdates {uroot} | R Documentation |
This function determines the year and season to which a given observation in the sample is related to, and the location in the sample of a given time specified by the year and the season.
Mdates (wts, yso)
wts |
a univariate time series object. |
yso |
either a vector of length two indicating the year and season or a vector on length one indicating the location in the sample of an observation. |
An object of class vdate-class.
Javier López-de-Lacalle javlacalle@yahoo.es and Ignacio Díaz-Emparanza Ignacio.Diaz-Emparanza@ehu.es
## Mdates
data(AirPassengers)
## Which date is related to the 12th observation?
out1 <- Mdates(AirPassengers, 12)
out1
out1@Myso
## Where is located the observation in 1959.2
out2 <- Mdates(AirPassengers, c(1959,2))
out2
## Beyond the sample.
Mdates(AirPassengers, 150)
Mdates(AirPassengers, c(1970,2))
## Which is the next date after the 12th observation?
stepdate(as.vdate(AirPassengers, yso=12), step=1)