I have a data.frame that has two columns only. one is barcodeid
and the other is gene
.
barcodeid gene
M001-M008-S137 IL12RB1
M001-M008-S137 IL7RA
M001-M008-S137 LMP1
M001-M012-S080 CRLF2
M001-M012-S080 ICOS
M001-M012-S080 IL7RA
I want to end up with this table:
barcodeID geneSequence
M001-M008-S137 IL12RB1-IL7RA-LMP1
M001-M012-S080 CRLF2-ICOS-IL7RA
I've looked up reshape
, dcast
, spread
, gather
in r and as far as I can tell these are not the functions that would allow me to do this. Appreciate any help!