How to replace values of variable-A and variable-B with NA if the variable-A value is smaller than the corresponding value in variable B. It is in R. I know that I have to use some sort of for-if-else statement, but I am lost.
Let's say I have a dataframe with 2 variables, A and B. And everytime the value of variable A is lower than the value of variable B, I want the values (from variable A and B) to be replaced with NA.