I have been given a csv with a column called month as a char variable with the first three letters of the month. E.g.:
\"Jan\", \"Feb\",\"Mar\",...\"Dec\" >
Use match and the predefined vector month.abb:
match
month.abb
tst <- c("Jan","Mar","Dec") match(tst,month.abb) [1] 1 3 12