The script works well for MacOS. I found two things I had to change/remember
- make the script executable on Mac (https://support.apple.com/de-de/guide/terminal/apdd100908f-06b3-4e63-8a87-32e71241bab4/2.10/mac/10.15)
- change the version number in the script to R 4.0.0
On Windows you would have to install a new version of RTools in oder to get R 4.0 up and ruinning
https://cran.r-project.org/bin/windows/Rtools/