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)
x
: Input of class yearmon()
This function returns a two-dimensional numerical array of type c(YEAR,PERIOD)
.
date2yp
ym2yp
GETDATE
#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'))))