[R] fill=T?

karena dr.jzhou at gmail.com
Wed Mar 7 22:32:51 CET 2012


If a text file has rows of variable lengths. How to read the file into R?

I think some people may suggest using 'fill=T', however, it sort of messes
the data up, for example, in the text file:
a    b    c    d
1    2    3    4
1          8    6
1    2          0
1    1    0    
 
If I read in the file using 'read.table("data", head=T, fill=T), then the
data.frame in R will be:
a    b    c    d
1    2    3    4
1    8    6    NA
1    2    0    NA
1    1    0    NA

Could anyone tell me how to handle this?

Thank you very much,

Karena

 

--
View this message in context: http://r.789695.n4.nabble.com/fill-T-tp4454751p4454751.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list