[Rd] Re: [R] Several R vs S-Plus issues
Thu, 4 Oct 2001 18:14:48 +0200
>>>>> Thomas Lumley writes:
> On Thu, 4 Oct 2001, Kurt Hornik wrote:
>> >>>>> David Brahm writes:
>> > - LETTERS[c(NA,2)] in S is c("","B"), but in R is c("NA","B")
>> I think we do not want to change this.
>> Splus has
>> > (1:2)[c(NA,2)]
>>  NA 2
>> > is.na((1:2)[c(NA,2)])
>>  T F
>> > is.na(c(TRUE, FALSE)[c(NA,2)])
>>  T F
> I think we do want to change this (as we discussed quite recently) but
> by adding a genuine character NA. The problem is not that
> LETTERS[c(NA,2)] returns a missing value, it's that it isn't missing
> enough. We need a "NaS" (Not a String) value that can't be confused
> with Nabisco, but also can't be confused with an empty string.
Agreed. As Peter said, subscripting by NA should give NA but R cannot
distinguish a string NA from the string NA. However, David (I think)
was suggesting that subscripting a string with NA should give an empty
string, which I think cannot be right. It must be NaS in your sense.
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To: email@example.com