Get the corresponding month for the string that represent maturities of
futures contracts.
Arguments
- x
a character with letters that represent the month of maturity of
futures contracts.
Value
a vector of integers
Examples
code2month(c("F", "G", "H", "J", "K", "M", "N", "Q", "U", "V", "X", "Z"))
#> [1] 1 2 3 4 5 6 7 8 9 10 11 12
code2month(c("JAN", "FEV", "MAR", "NOV", "DEZ"))
#> [1] 1 2 3 11 12