Skip to content
Prev 22558 / 63424 Next

NA handling in as.character applied to a list

Seth Falcon <sfalcon at fhcrc.org> writes:
Hmm...
[1] NA   "NA" "NA"

This does look like a leftover from times when there was no character
NA in the language. It is the kind of thing you need to be very
careful about fixing though. (I have a couple of scars from
as.character on formulas when introducing backtick quoting.)


BTW, another little bit of nastiness popped up when playing around
with this:
structure(list(a = NA, b = NA, c = as.integer(NA)), .Names = c("a",
"b", "c"))
a           b           c
"character"   "logical"   "numeric"