标签: 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。
1 and 2
0 and 1
可以做到吗?
非常感谢