From ggrothendieck at gmail.com  Fri Dec 17 15:32:18 2010
From: ggrothendieck at gmail.com (Gabor Grothendieck)
Date: Fri, 17 Dec 2010 09:32:18 -0500
Subject: [Rd] Surprising behavior of letters[c(NA, NA)]
Message-ID: <AANLkTikMgfMC35MPrr7DGtToovTFsbWMrM3fGX=bskA3@mail.gmail.com>

Consider this:

> letters[c(2, 3)]
[1] "b" "c"
> letters[c(2, NA)]
[1] "b" NA
> letters[c(NA, 3)]
[1] NA  "c"
> letters[c(NA, NA)]
 [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
[26] NA

The result is a 2-vector in each case until we get to c(NA, NA) and
then it unexpectedly changes from returning a 2-vector to returning a
26-vector.  I think most people would have expected that the answer
would be c(NA, NA).


-- 
Statistics & Software Consulting
GKX Group, GKX Associates Inc.
tel: 1-877-GKX-GROUP
email: ggrothendieck at gmail.com



[Rd] Surprising behavior of letters[c(NA, NA)]
Gabor Grothendieck