My data looks like this:
Sample_A Sample_B Value
Rabbit Mouse 1.2
Mouse Tiger 7.89
Tiger Lion -0.9
Mouse Rabbit 1.2
Lion Rabbit 98.13
I would like to turn it into this format:
Lion Tiger Mouse Rabbit
Rabbit 98.13 . .
Mouse
Lion
Tiger
so, I would like the rows of my 2nd column (sample2) each become a column by itself and then the assigned values be assigned accordingly. The order of the sample names does not matter. My real data has 2000 rows and the same 3 columns. Is there any way to prepare my desired matrix in R? any function to use? Later on I plan to graph it and that's why I need it. Thanks