I have a large data matrix (37000 x 2689) with duplicated rownames, I am trying to consolidate column values (samples) by their row names. I have tried using sum by package dplyr but it does not help Eg, here gene column would ideally have become the rowname but R does not allow duplicate row names.
gene sampleA sampleB sampleC
aaa 0 0 78
bbb 0 0 1
ccc 0 0 34
aaa 0 10 0
bbb 0 2 0
ccc 0 17 0
aaa 3 0 0
bbb 900 0 0
ccc 6 0 0