I had a big problem, installing some packages on my Mac M1. But, I was unable to install them. Now, I could successfully solve the problem and I wanted to share it. If you have a Mac M1, you should install a specific version of R ( R-4.1.2.pkg), not ( [R-4.1.2-arm64.pkg].
This. is the link if you want to install it:
Please consider that if you want to install the other version, all your installed packages will be deleted and you have to install it again. But, to me, it was no big deal.