Hi, and welcome!
Please see the FAQ: What's a reproducible example (`reprex`) and how do I do one? Using a reprex, complete with representative data will attract quicker and more answers.
You have most of a reprex
, including the vital data, but I'm at a loss for the code that throws the error. Can you edit your question to include that?