From mwtoews at sfu.ca  Thu Oct 26 03:54:10 2006
From: mwtoews at sfu.ca (Michael Toews)
Date: Wed, 25 Oct 2006 18:54:10 -0700
Subject: [Rd]  NA handling in as.character applied to a list
References: m24ptsay46.fsf@ziti.local
Message-ID: <45401542.3090305@sfu.ca>

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



[Rd] NA handling in as.character applied to a list
Michael Toews