R is a programming language and open-source, cross-platform software environment for graphics and computing. Developed in 1995, it has become one of the main languages used for data science and machine learning today. R is popular among not only academics but also global tech giants like Google and Microsoft as well.

In this article, you’ll find the easiest way to download R for Mac. We’ll as well dig into everything you need to know to install RStudio, which is an integrated development environment (IDE). It makes using R much easier because of its user-friendly interface and a bunch of customization options. Let’s get started!

Did you know?

R language is named after the first names of its developers — Ross Ihaka and Robert Gentleman.

How to prepare your Mac for R installation

Before installation, make sure you have at least 500 MB of free storage space on your Mac. To check it, go to the Apple menu in the top-left corner and choose About This Mac > More Info > Storage Settings. Alternatively, go to System Settings > General > Storage. 

System Preferences - Storage

If your space is a bit cluttered with files and data, you should consider clearing your hard drive before installing R.

All the junk files you have on your computer not only occupy gigabytes of space but also overload the CPU a lot. Heavy junk clusters can hide deeply in your system, so getting a little help with cleanup is the way to go.

CleanMyMac by MacPaw is one of our favorite tools, as it helps you manage your storage, maintain your Mac’s performance, and protect it from malware all at once. Here’s how to use it:

  1. Download and install CleanMyMac — get the app for free here.
  2. Open it and run the Smart Care by clicking Scan.
  3. Once you see results, click Run to clear the junk and perform other essential tasks for your Mac.
CleanMyMac - Smart Scan complete

You can also check out the My Clutter feature to remove the heaviest files and duplicates that have been piling up on your Mac for way too long. Now, your Mac is ready for installing R.

Installing R on your Mac step-by-step

The easiest way is to install R through the Comprehensive R Archive Network (CRAN). Note that CRAN doesn’t have Mac OS X systems and can’t check these binaries for viruses. So they recommend using standard security precautions.

Even though severe malware attacks are not so frequent on macOS, regular checkups are essential. Luckily, CleanMyMac includes a Protection feature to protect your Mac from hazards.

Malware removal module of CleanMyMac

To check your Mac for malicious programs, including viruses and worms:

  1. Open CleanMyMac.
  2. Navigate to Protection.
  3. Click Scan to let the app analyze your system.
  4. If it finds something malicious, click Remove to get rid of it.

Now that your Mac is protected, it’s time to visit the CRAN download page and grab your copy of R. It’s totally free. Here are some steps to follow:

  1. Open your browser and go to cran.r-project.org.
  2. Click Download R for macOS.
  3. Click on the first link under the Latest Release. Select the version that would work with your Mac based on the chip it comes with — Apple silicon or Intel. 

  4. Double-click the .PKG file from the Downloads folder to open the package installer.

  5. Follow the on-screen instructions to proceed with the installation. Accept the default settings.
  6. Once done, move the installer to the Trash.
  7. Finally, click Close. Congratulations! Now you have R on your Mac.

How to download RStudio for Mac

Note

To run RStudio on your Mac, you should install R first. RStudio will show you a warning message if it detects that R hasn’t been installed yet.

  1. Visit rstudio.com and go to Products.
  2. Choose RStudio and click Download RStudio Desktop.
  3. Choose the version you prefer — Free or Pro — and click Download RStudio for Mac.

  4. Open the .DMG file from your Downloads folder.
  5. Drag and drop the RStudio icon to the Applications folder.

Done! RStudio is now installed on your computer.

R and RStudio are great tools for exploring and analyzing the data. We hope this detailed guide helped you dive into the world of R programming on your Mac. Keep your computer in good shape to make the most of it. Declutter and optimize your Mac performance once in a while. CleanMyMac can help you with that in a few clicks. Thanks for reading!