Re: [Rd] NA handling in as.character applied to a list

2006-10-26 Thread Seth Falcon
Peter Dalgaard <[EMAIL PROTECTED]> writes: > Hmm... > >> as.character(v) > [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 > a

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

2006-10-25 Thread Michael Toews
Okay ... I'll try to attach that patch once more ... (does this list only accept certain exertions for attachments? I used '.patch', but it must have been filtered off, so I'll try '.patch.txt' now ...) +mt Index: R/src/library/base/man/character.Rd ==

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

2006-10-25 Thread Michael Toews
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 no

Re: [Rd] NA handling in as.character applied to a list

2006-10-25 Thread Peter Dalgaard
Seth Falcon <[EMAIL PROTECTED]> writes: > Hi all, > > In some circumstances, as.character applied to a list converts real > NA's into the string "NA". Propagation of NAs is something R does > very well and unless there are good reasons for losing the NA, it > would improve the consistency w.r.t.

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

2006-10-25 Thread Seth Falcon
Hi all, In some circumstances, as.character applied to a list converts real NA's into the string "NA". Propagation of NAs is something R does very well and unless there are good reasons for losing the NA, it would improve the consistency w.r.t. NA handling for as.character to behave differently.