How To Install RStudio in Mac

Before installing RStudio, please make sure that you have enough free space on your local mac. We will require this space to install both R and RStudio, and when the program installs, the compressed files expand to take much more space.

Now, let’s install R on Mac, and then we install RStudio.

Note: For RStudio to work on Mac, R needs to be installed first.

How to Install R in Mac

To Install R in mac, follow the below steps.

  1. Open the web browser and go to www.r-project.org.
  2. Click the “Download R” link in the middle of the page under “Getting Started.”
  3. Select the CRAN location (a mirror site) for nearest region and click the corresponding link.
  4. Click on the “Download R for (Mac) OS X” link at the top of the page.
  5. Click on the file containing the latest version of R under “Files.”
  6. Save the .pkg file, double-click it to open, and follow the installation instructions.
  7. After installing R, you need to download and install RStudio.

Testing R

Double-click on the R icon in the Applications folder. A window titled “R Console” should pop up.

You maybe see something like below.

Install R in Mac

Here, we got some warnings that can be solved by following the below steps.

  1. Open Terminal
  2. Write or paste in: defaults write org.R-project.R force.LANG en_US.UTF-8
  3. Close Terminal (including any RStudio window)
  4. Start R

That will resolve the issue, and now our r console looks like below.

Solve UTF R Errors

The > character is called the prompt and is the place where we enter the commands for the program to interpret.

For instance, if you type 11+21 followed by the return/enter key, you will see:

Testing R

That means the installation of R is successful.

To quit R, you have to. call the quit function by typing the q() in the console and hit the return key.

How to Install RStudio on Mac

To install RStudio in Mac For Free, you have to download it from the website first.

Go to the rstudio.com and click on the Free RStudio Desktop, which is free under Open Source License. 

You will go to this page.

Install RStudio on macOS

Then click on Download RStudio For Mac button, and it will save the .dmg file on your machine, double-click it to open, and then drag and drop it to your applications folder.

Now, open the RStudio, and it looks like below.

Install RStudio in Mac

To exit RStudio, click “RStudio” in the menu bar, then click “Quit RStudio”. Alternatively, use the CMD + Q shortcut.

If prompted to save the workspace, do not save it.

If you want to get the Paid version or commercial version of RStudio, then go this link: https://rstudio.com/products/rstudio/download/

You will find various commercial versions for your needs.

So, that is it for installing R and RStudio on Mac.

Leave a Comment