Also, Splus 7 has a different behaviour from R:
> sapply(v, is.na)
a b c
F T T
> sapply(as.character(v), is.na)
[1] F F F
> as.character(v)
[1] "\"NA\"" "NA"     "NA"

In R, it remains logical: if it isn't in character mode, then as.character always turns NA's into "NA"'s. If that behaviour is not desired, and you want to keep character NA's as true NA's, then you can test from the original object.

I agree that is dangerous to change the behaviour of simple things like this, and don't recommend any change in behaviour. However, this isn't documented, so here is my suggested patch for ?as.character . (Edit this as necessary).
+mt

______________________________________________
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel

Reply via email to