I have this data
COL AABC1 AAAABD2 AAAAAABF3
I would like to make a certain column like this:
COL NEW_COL AABC1 T1 AAAABD2 T2 AAAAAABF3 T3
If COL contains 'BC', NEW_COL will be T1
contains 'BD', it will be T2
contains 'BF', it will be T3.
I would like to use mutate and grepl function but I have 80 conditions (like BC>T1) so that the code does not work in the R.
With the table like:
CLASS NEW_COL BC T1 BD T2 BF T3
Could I use mutate(create) new column with above standard table ??