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.
Even if the answer turns out to be relatively simple, if the problem is difficult because it requires reverse-engineering, it will probably lie undiscovered.