Hi @Miro
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. A question like this is very hard to answer in the abstract without reverse engineering the problem. Although that is sometimes possible it takes away from the time I spend volunteering (as much as I would like this to be paid, it isn't!) helping others.