Mdates: Determine the Location in the Sample of a Date and vice versa

Description Usage Arguments Value Author(s) See Also Examples

Description

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.

Usage

1
2
    Mdates (wts, yso)
  

Arguments

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.

Value

An object of class vdate-class.

Author(s)

Javier Lopez-de-Lacalle javlacalle@yahoo.es and Ignacio Diaz-Emparanza Ignacio.Diaz-Emparanza@ehu.es

See Also

stepdate-methods.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
    ## 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)
  

uroot documentation built on May 2, 2019, 6:49 p.m.

Related to Mdates in uroot...