2

I am working with a df, one column is factor, value from January to December, I want to convert them into numbers, such as January ——> 1

Kerui Cao
  • 53
  • 5

1 Answers1

3
x <- c("September", "December", "January")
match(x, month.name)

[1]  9 12  1
Georgery
  • 7,643
  • 1
  • 19
  • 52