Im trying to wrap my hear around restructuring operations with dplyr but can't solve this one, maybe one of you can help :)
df <- data.frame(
gene = c("ABC", "ABC", "AA", "AB", "AC", "DD", "DE", "AA", "AR", "ABC"),
genotype = c("ht", "cpht", "ht", "cpht", "hm", "hm", "cpht", "ht", "hm", "cpht"),
consequence = c("utr3", "miss", "miss", "stop", "utr5", "miss", "stop", "miss", "utr3", "utr5")
)
I would like to create a new df that should look like this:
Supposedly this should be easily done with dplyr but I cant get it to work. Maybe one of you can?
Thanks a lot! Sebastian