Skip to content

Instantly share code, notes, and snippets.

@statgeek
Created June 5, 2020 16:15
Show Gist options
  • Save statgeek/6e24924247df53a872df1a9a2497e142 to your computer and use it in GitHub Desktop.
Save statgeek/6e24924247df53a872df1a9a2497e142 to your computer and use it in GitHub Desktop.
R - convert a month number to a month name
month <- c(12,3,6,2,3,7)
month.abb[month]
#[1] "Dec" "Mar" "Jun" "Feb" "Mar" "Jul"
#To apply as label in graphs:
factor(month.abb[serviceMonth], levels=month.abb)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment