We do not have your data to reproduce the problem and not a lot of information to understand what you want to do. With your data (or a subset) it will be easier to help.
Could you ask this with a minimal REPRoducible EXample (reprex)? A reprex makes it much easier for others to understand your issue and figure out how to help.