I have a question regarding the IF function.
Here is my table, I would like in column D to have the same thing as in column C except that I would like to replace the "Unidentified" by the closest known taxonomic resolution as the example below:
df <- tribble( ~A, ~B, ~C, ~D, , Mycto, Unidentified, Unidentified, NA, Mact, Prio, Boreo, NA, Lui, Bra, Unidentified, NA, )
Created on 2022-05-06 by the reprex package (v2.0.1)
Here for the first line Unidentified (column C) is replaced by Mycto because it is the closest known taxo resolution. On the other hand, for the 3rd line, the closest known taxo resolution is in column B, so Bra.
What would be the formula to enter in column D to have this kind of results?
Thanks very much !