From p.dalgaard@biostat.ku.dk  Wed Apr 10 10:08:32 2002
From: p.dalgaard@biostat.ku.dk (Peter Dalgaard BSA)
Date: 10 Apr 2002 11:08:32 +0200
Subject: [Rd] Problem handling NA indexes for character matrixes (PR#1447)
In-Reply-To: <200204092252.AAA02600@pubhealth.ku.dk>
References: <200204092252.AAA02600@pubhealth.ku.dk>
Message-ID: <x2bscr9azz.fsf@blueberry.kubism.ku.dk>

gregory_r_warnes@groton.pfizer.com writes:

> In a package I've been developing for manipulating genetic data I discovered
> a problem when indexing into character arrays using NA's:

> 	> cmat[ indvec,  ]
> 	     [,1] [,2]
> 	[1,] "a"  "c" 
> 	[2,] "b"  "d" 
> 	[3,] "NA" ""  
> 	> nmat[ indvec,  ]
> 	     [,1] [,2]
> 	[1,]    1    3
> 	[2,]    2    4
> 	[3,]   NA   NA

This seems to have vanished in R-1.5.0pre, likely as a (fortunate, if
unexpected) side effect of the character NA changes:

> cmat[ indvec,  ]
     [,1] [,2]
[1,] "a"  "c" 
[2,] "b"  "d" 
[3,] NA   NA  
> nmat[ indvec,  ]
     [,1] [,2]
[1,]    1    3
[2,]    2    4
[3,]   NA   NA

-- 
   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard@biostat.ku.dk)             FAX: (+45) 35327907
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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] Problem handling NA indexes for character matrixes (PR#1447)
Peter Dalgaard BSA