Hi all I have a table
id sample_name replicates raw
a control c1 1
a control c2 2
a control c3 3
b control c1 10
b control c2 20
b control c3 20
and would like to transform this to
id c1 c2 c3
a 1 2 3
b 10 20 20
The only way I know how to do this is to brute loop through every 3, because there are 3 replicates and append that to multiple vectors and recombine it at the end into a dataframe, thus I'm wondering if there is a more elegant/simple way to do this? thanks!