Кодовый фрагмент:
blarg = data.frame(a=c("aa", "bb", "dd"))
blarg$b = blarg$a
# blarg$b is now c("aa", "bb", "dd")
blarg$b = ifelse(blarg$a!="bb",blarg$a,"ZZZ")
# blarg$b is now c(1, "ZZZ", 3)
# I expected c("aa", "ZZZ", "dd")
# typeof(blarg$b) is "character"
Почему blarg $b c (1, "ZZZ", 3)? Откуда берутся цифры?