Even if it's true that your code is not the problem, a reproducible example would help us to diagnose what the actual problem is, so, please provide a REPRoducible EXample (reprex) illustrating your issue.
Even if it's true that your code is not the problem, a reproducible example would help us to diagnose what the actual problem is, so, please provide a REPRoducible EXample (reprex) illustrating your issue.