yq2yp function

yearqtr to Year-Period Conversion

yearqtr to Year-Period Conversion

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

yq2yp(x = NULL)

Arguments

  • x: Input of class yearmon()

Returns

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

See Also

date2yp

ym2yp

GETDATE

Examples

#day and month names can change depending on locale Sys.setlocale('LC_ALL','C') Sys.setlocale('LC_TIME','C') print(yq2yp(as.yearqtr('2001 Q3'))); #print c(2001,3) print(yq2yp(c(as.yearqtr('2000 Q2'),as.yearqtr('1987 Q4'),as.yearqtr('2003 Q1'))))
  • Maintainer: Andrea Luciani
  • License: GPL-3
  • Last published: 2024-11-25