Thanks for following up. Here is the 'before' table using the dput function:
structure(list(CellType = c("CellA", "CellB", "CellC", "CellC",
"CellA"), Gene1 = c("NULL", "Wt", "Wt", "Mut", "Mut"), Gene2 = c("NULL",
"NULL", "Mut", "Mut", "Wt")), row.names = c(NA, -5L), class = c("tbl_df",
"tbl", "data.frame"))
Also, can you please clarify the issue with the assignment rules in the 'after' table? Essentially, my aim is to generate a summed score per cell type if R can recognise the 3 text items I had mentioned. For example, in Cell C, Gene 2 has two mutations (i.e. 'Mut'). Since each mutation has a score of 1, then the resulting addition should produce a value of 2 as seen in the 'after' table.
Would greatly appreciate your help with coming up with a code that can allow me to get this type of result.
Cheers,
Adam