Hello, I have a data frame with three columns, where the first of them is the samples ID, the second one are the genes that have been found mutated in these samples (cancer samples) and the last one indicates the source where the sample was obtained. Please do notice that every gene is in a row, so if a sample has three genes mutated, the sample ID and the source information will be repeated in every row. I would like to transform the gene column into multiple column names, and if a sample had mutated that gene, it should show a "1". On the other hand, if the gene were not mutated, it should show a "0", so every gene should not be repeated.
is it possible to do that? how can I get it using R?
Thanks in advance!
Please, post example data as well as what you have already tried!