[R] Transpose and NA's

Neil Klepeis nklepeis at uclink4.berkeley.edu
Mon Jul 15 07:33:36 CEST 2002


I noticed some odd behavior when I transpose a data frame containing 
NA's.   It seems to cast all the elements as "character" including the 
NA's.   Bug?

 > t(data.frame(x=1:10,y=1:10,z=rep(NA,10)))
   1      2      3      4      5      6      7      8      9      10
x " 1"   " 2"   " 3"   " 4"   " 5"   " 6"   " 7"   " 8"   " 9"   "10"
y " 1"   " 2"   " 3"   " 4"   " 5"   " 6"   " 7"   " 8"   " 9"   "10"
z "  NA" "  NA" "  NA" "  NA" "  NA" "  NA" "  NA" "  NA" "  NA" "  NA"
 >


-- 
______________________________________________________
Neil E. Klepeis, UC Berkeley, School of Public Health,
and Lawrence Berkeley National Laboratory,
Berkeley, CA USA.

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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