We don't really have enough info to help you out, since we don't now the structure of your data and your desired output, 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.