Download and install R itself
RStudio is a shell around R — R is the actual engine that runs your code. You must install R first or RStudio will open but refuse to do anything useful. Go to the official R download page and grab the installer for your operating system.
On macOS Apple Silicon (M1/M2/M3) you must download the 'arm64' build of R, not the Intel one, or performance will be very poor.
On the macOS download page, look for the file ending in '-arm64.pkg' and download that one instead of the standard '.pkg'.
