[Rd] paste() with NAs .. change worth persuing?
Martin Maechler
maechler at stat.math.ethz.ch
Wed Aug 22 17:50:43 CEST 2007
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
More information about the R-devel
mailing list