Iterating down a column HELP!

Hello,

Please can you follow the advice on FAQ: Tips for writing R-related questions.

You'll see a reprex will help. Currently, we have no idea about what data is and you error may comes from it and how you test it in if.