I have a data frame that looks a lot like:
Sample Start End Chr Gene Data
1 1 50 1 A -0.2
1 60 84 1 B -0.4
2 60 84 1 B 0.3
3 1 50 1 A 0.1
I'd really like to create a data frame that has this data displayed in a more easy to manage form, such as ...
Sample GeneA GeneB GeneC ...
1 -0.2 -0.4 NA
2 NA 0.3 NA
3 0.1 NA NA
Is there a function that can help me this this ... so far I've managed to make an empty data frame with sample names and gene names listed as rows, but I'm struggling to work out how to correctly feed the data into this table.
Thanks for any advice for this query.
Natalie