Converting the month in one colume to the corresponing numeric

dataz1$Month = as.numeric(dataz1$Month)

For example, May = 5

dataz1$Month <- match(dataz1$Month, month.name)

month.name is a constant in the base package.

2 Likes
library(lubridate)
x <- ymd("2012-03-26")
> month(x)
[1] 3

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.