I have a data set where each 'subject' with a particular 'stim' condition has a certain value for the variable 'FOXP3', 'GATA3' and 'GZMB'. I would like to group the 'subject' and 'stim' together to get the corresponding values for 'FOXP3', 'GATA3' and 'GZMB'.
So the data looks like this:
subject stim FOXP3 GATA3 GZMB
TA no stim 0 0.50 0
SA 11002 1 0 0.9
RK 4512 0.3 0.5 0.9
I want the data to look like this
TA+no stim SA+11002 RK+4512
FOXP3 0 1 0.3
GATA3 0.5 0 0.5
GZMB 0 0.9 0.9
How do I do it?