I am working on mutational data of genes which consists of one column per gene, with the gene either having "no alteration", or a specific mutation. In one column, I want the non-altered genes to be changed to "Wildtype", and all the different mutations to be changed to simply "Mutated". I have tried using the conditional function for this with the following code:
dat$RB <- ifelse(dat$RB != "no alteration", dat$RB == "Mutated RB", dat$RB == "Wildtype RB")
However, when I use this, all values in the column simply change to "FALSE". Why is this not working, and what should I do to achieve my goal?