Hello,
It's very hard to guess the issue when you are now using your own data. I assume the problem is not happening when you run the code / data I provided.
It's best to share a reprex of the work you have done with your data so far, and we can then take a look at the error. It should be something easy to fix as I guess there is a data type issue (non-numeric argument to mathematical function).
A reprex consists of the minimal code and data needed to recreate the issue/question you're having. You can find instructions how to build and share one here:
Try to create one with the guide above, this will really help if you need this forum in future again as well!
PJ