Convert a numeric month to a month abbreviation

Take a look at the month.abb constant. For example, assume you have a vector of integers consisting of the number of the month, then you can use it to get the three letters abbreviation of the month name by doing:

> month <- c(12,3,6,2,3,7)
> month.abb[month]
[1] "Dec" "Mar" "Jun" "Feb" "Mar" "Jul"

Leave a Comment