I am trying to get this done in R. The cells in columns 2,3 and 4 contain numbers greater than 10 or 'NA'. Since this is already filtered data, I want to crosscheck with cells in columns 5,6 and 7. The datapoint in columns 5, 6 or 7 contain some alphabetical annotations. If the cells in columns 2,3 or 4 contain 'NA', then I want to convert the corresponding cell values in columns 5, 6 or 7 as 'N' or 'NA'.
My sample data is as follows:
ID S1 S2 S3 S4 S5 S6
M1 11 20 NA C C C
M2 NA 123 21 T T R
M3 NA NA 27 A A M
M4 65 23 NA G G C
M5 12 NA 13 T G C
My desired output is::
ID S1 S2 S3 S4 S5 S6
M1 11 20 NA C C N
M2 NA 123 21 T N R
M3 NA NA 27 N N M
M4 65 23 NA G G N
M5 12 NA 13 T N C
Thanks in advance. Jerry