Error in my script

Welcome to the forum.

I think that we really need a bit more information.

Some of the suggestions here may help. FAQ: How to do a minimal reproducible example ( reprex ) for beginners. Or here https://forum.posit.co/t/faq-how-to-do-a-minimal-reproducible-example-reprex-for-beginner00.