[R] Non-alignment of <NA> in rownames

Yi, Derek Derek.Yi at FMR.COM
Thu Aug 1 17:37:56 CEST 2002


Hello everyone,

Apologies in advance if you have received this multiple times!

On a thread similar to that posted by Don MacQueen
(http://www.r-project.org/nocvs/mail/r-help/2002/3455.html): is there any
way to nicely format NA's when listed as rownames?  When NA's are part of
rownames, the alignment is thrown off:

> z <- matrix(c(100, 200, 300))
> z
     [,1]
[1,]  100
[2,]  200
[3,]  300
> rownames(z) <- c("x", "y", NA)
> z
     [,1]
x     100
y     200
<NA>    300

This strikes me as strange, especially because the brackets don't affect NA
alignment elsewhere (like as an element in a dataframe or matrix).  Any
insights?

Thanks!
Derek

> R.version
         _                   
platform sparc-sun-solaris2.6
arch     sparc               
os       solaris2.6          
system   sparc, solaris2.6   
status                       
major    1                   
minor    5.1                 
year     2002                
month    06                  
day      17                  
language R

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help 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-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list