'ifelse' changes factors to character vectors (R-1.7.1, Linux): > table(bal$soc.40) tax noble semi-landless landless unknown 4035 5449 13342 9348 0 > blah <- ifelse(is.na(bal$soc.40), "unknown", bal$soc.40) > table(blah) blah 1 2 3 4 unknown 4035 5449 13342 9348 7970 How do I get what I want (I mean: simply)? Upgrade to 1.8.0? Göran