Error in my code

Hello, and welcome to the RStudio Community! We're glad you're here. :slight_smile:

Have you seen our guide to creating a minimal reproducible example (reprex)?

It's admittedly a bit long, but the TL;DR is that it's extremely helpful to post the actual code you used to generate the error, preferably in a form that can be directly copied and pasted into someone else's IDE and run.

Reading the code formatting FAQ may also be helpful: