The month.abb is a built-in R constant, a three-letter abbreviation for the English month names.
month.abb
Output
[1] "Jan" "Feb" "Mar" "Apr" "May" "Jun" "Jul" "Aug" "Sep" "Oct" "Nov" "Dec"
If you have a vector of integers consisting of the number of the month, then you can use it to get the three-letter abbreviation of the month name by doing the following.
mnth <- c(12, 10, 8, 6, 4, 2)
month.abb[mnth]
Output
[1] "Dec" "Oct" "Aug" "Jun" "Apr" "Feb"
Krunal Lathiya is a seasoned Computer Science expert with over eight years in the tech industry. He boasts deep knowledge in Data Science and Machine Learning. Versed in Python, JavaScript, PHP, R, and Golang. Skilled in frameworks like Angular and React and platforms such as Node.js. His expertise spans both front-end and back-end development. His proficiency in the Python language stands as a testament to his versatility and commitment to the craft.
The colSums() function in R calculates the sums of columns for numeric matrices, data frames,…
The rowSums() function calculates the sum of values in each numeric row of a matrix,…
The View() is a utility function in R that invokes a more intuitive spreadsheet-style data…
The summary() is a generic function that produces the summary statistics for various R objects,…
The paste() function in R concatenates vectors after converting them to character. paste("Hello", 19, 21,…
R paste0() function concatenates strings without any separator between them. It is a shorthand version…