For this kind of question it's really useful to pose it with an example of the code you're using, reproducing the issues you're running into.
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.