From maechler at stat.math.ethz.ch  Wed Aug 22 17:50:43 2007
From: maechler at stat.math.ethz.ch (Martin Maechler)
Date: Wed, 22 Aug 2007 17:50:43 +0200
Subject: [Rd] paste() with NAs ..  change worth persuing?
Message-ID: <18124.23379.575814.316093@stat.math.ethz.ch>


Consider this example code

 c1 <- letters[1:7]; c2 <- LETTERS[1:7]
 c1[2] <- c2[3:4] <- NA
 rbind(c1,c2)

  ##   [,1] [,2] [,3] [,4] [,5] [,6] [,7]
  ## c1 "a"  NA   "c"  "d"  "e"  "f"  "g" 
  ## c2 "A"  "B"  NA   NA   "E"  "F"  "G" 

  paste(c1,c2)

  ## -> [1] "a A"  "NA B" "c NA" "d NA" "e E"  "f F"  "g G" 

where a more logical result would have entries 2:4 equal to
      NA 
i.e.,  as.character(NA)
aka    NA_character_

Is this worth persuing, or does anyone see why not?

Regards,
Martin



[Rd] paste() with NAs .. change worth persuing?
Martin Maechler