[R] Reshaping columns

efulas ef_ulas at hotmail.com
Sat Jun 9 12:21:59 CEST 2012


Dear all,


I have a data frame with 2 columns and 102500 rows. The data looks like
below


V1        V2
8098    110000.......
9099    001100.......
0023    110011.......
6545    111111.......
.             .
.             .
.             .
.             .
.             .


I want to split the colums like this ;

V1      V2     V3  V4  V5  V6  v7
8098    1      1      0   0     0    0 ......
9099    0      0      1   1     0    0 .......
0023    1      1      0   0     1    1 .......
6545    1      1      1   1     1    1 .......
.             .      .       .       .     .      .
.             .
.             .
.             .
.             .


Is there anyway to do this in R.



Many Thanks

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



More information about the R-help mailing list