0
我目前正在尝试更改数据帧列中的性别值以保持一致性。 我目前有以下代码,但它不会更改任何行值。它为每个值一致地打印“男性”,但不会在数据帧中更新。替换列值如果它包含一个字符串或字符R
count <- 0
for(i in mySubset$Gender){
count = count + 1
if('Male' %in% i){
mySubset$Gender[count] <- 'male'
print(mySubset$Gender[count])
}
}
可以显示样本数据和期望的输出吗? –