From Kurt.Hornik@ci.tuwien.ac.at  Thu Oct  4 17:14:48 2001
From: Kurt.Hornik@ci.tuwien.ac.at (Kurt Hornik)
Date: Thu, 4 Oct 2001 18:14:48 +0200
Subject: [Rd] Re: [R] Several R vs S-Plus issues
In-Reply-To: <Pine.A41.4.33.0110040846520.100374-100000@homer38.u.washington.edu>
References: <15292.6722.281945.237767@mithrandir.hornik.net>
 <Pine.A41.4.33.0110040846520.100374-100000@homer38.u.washington.edu>
Message-ID: <15292.35576.513722.492732@mithrandir.hornik.net>

>>>>> 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)]
>> [1] NA  2
>> > is.na((1:2)[c(NA,2)])
>> [1] T F
>> > is.na(c(TRUE, FALSE)[c(NA,2)])
>> [1] 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.

-k
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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: r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._


[Rd] Re: [R] Several R vs S-Plus issues
Kurt Hornik