我正在使用df,一列是因子,一月到十二月的值,我想将它们转换为数字,例如一月-> 1
x <- c("September", "December", "January") match(x, month.name) [1] 9 12 1