Hello, I need to remove characters from a string based on multiple conditions. The data I have looks like this: Animal Form Days Days_Expected Days_Missing 1001 exam 1,2,3,36,103 0,1,2,4,36,103 0,4 1001 lab 1,2,3,36,100 0,1,2,4,30,100 0,4,30 So I need a function that will remove characters from the missing value based on criteria in the days value. For instance, If form=exam and days contains '3', then remove '4' from days_missing and if form=exam and days contains '1', then remove '0' from days missing. Also, if form=lab and days contains '1' then remove '0' from days_missing The outcome wanted would be this: Animal Form Days Days_Expected Days_Missing 1001 exam 1,2,3,36,103 0,1,2,4,36,103 1001 lab 1,2,3,36,100 0,1,2,4,30,100 4,30
... View more