更改R

时间:2019-11-12 19:35:41

标签: r

如果我有以下向量:

x<-c("blue","green","green","blue","blue")

转换为因子时,我发现以下内容:

Factor w/ 2 levels "blue","green": 1 2 2 1 1

我想将数字1 and 2更改为0 and 1

可以做到吗?

非常感谢

0 个答案:

没有答案