Type "RStudio" on the search bar of the computer. Open RStudio.
On RStudio, Click File β Open File.
Find the Script file that you just downloaded, and click Open.
DO NOT DOUBLE CLICK R SCRIPT FILES. It may open R, instead of RStudio.
Downloading R and RStudio to a personal computer
You can download R and RStudio to your personal computer. "Install and load packages" codes will install the packages once, but every time you open RStudio on your personal computer, you should run "Install and load packages" again.
macOS may want you to allow it to download. Open System Preferences, navigate to Security & Privacy, and then General. See the photo below and hit allow (you may need to click the lock at the bottom to unlock)