Remove duplicates based on a variable but ignoring NA's

Of course a reprex would help YOU here:

  • it makes it more convenient for the reader to help you out:
    no need to create test data
  • it shows that you think your issue so important, that you took the trouble to create a reprex: an incensive for some people to help you