Is there any function/way to merge/unite the following data

  GENEID      col1          col2             col3                col4
  G234064         1             0                  0                   0
  G234064         1             0                  0                   0
  G234064         1             0                  0                   0
  G234064         0             1                  0                   0
  G234065         0             1                  0                   0
  G234065         0             1                  0                   0
  G234065         0             1                  0                   0
  G234065         0             0                  1                   0
  G234065         0             0                  1                   0
  G234065         0             0                  0                   1


into
GENEID      col1          col2             col3                col4
  G234064         1             1                  0                   0
// 1 appears in col1 and col2 above, rest are zero
  G234065         0             1                  1                   1
// 1 appears in col2 , 3 and 4 above.


Thanks



-- 
Fahim

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to