ym2yp {bimets} | R Documentation

## 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

`date2yp`
`yq2yp`
`GETDATE`

### 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'))));

[Package bimets version 1.4.0 Index]