Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

ym2yp

yearmon to Year-Period Conversion


Description

This function transforms an input variable of class yearmon() into an equivalent two-dimensional numerical array of type c(YEAR,PERIOD).

Usage

ym2yp(x = NULL)

Arguments

x

Input of class yearmon()

Value

This function returns a two-dimensional numerical array of type c(YEAR,PERIOD).

See Also

Examples

#day and month names can change depending on locale
  Sys.setlocale('LC_ALL','C')
  Sys.setlocale('LC_TIME','C')
  
  print(ym2yp(as.yearmon("Dec 2013"))); #print c(2013,12)
  print(ym2yp(c(as.yearmon('Jan 2000'),as.yearmon('Dec 1987'),
        as.yearmon('Jan 2003'),as.yearmon('Mar 2012'))))

bimets

Time Series and Econometric Modeling

v1.5.3
GPL-3
Authors
Andrea Luciani [aut, cre], Roberto Stok [aut], Bank of Italy [cph]
Initial release
2021-02-04

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.