datetime - convert mmm to numeric in R -
i have been given csv column called month char variable first 3 letters of month. e.g. "jan", "feb","mar",..."dec".
is there way convert numeric representation of month, 1 12, or type in date format?
thanks.
use match
, predefined vector month.abb
:
tst <- c("jan","mar","dec") match(tst,month.abb) [1] 1 3 12
Comments
Post a Comment