001、
test <- as.factor(c(2, 3, 7, 8)) test as.numeric(test) ## 不能直接将因子型转换为数值型 as.numeric(as.character(test)) ## 先转换为字符,然后转换为数值