---
description: In this tutorial, you will learn How to Download and Install RStudio in Anaconda for Mac &amp; Windows, Install R on Mac &amp; Windows, and test R scripts.
title: How to Download &#038; Install RStudio in Anaconda [Windows/Mac]
image: https://www.guru99.com/images/r_programming/032818_0958_HowtoDownlo1.png
---

 

[Skip to content](#main) 

## What is R?

R is a programming language. To use R, we need to install an **Integrated Development Environment** (IDE). **Rstudio** is the Best IDE available as it is user-friendly, open-source and is part of the Anaconda platform.

## What is Anaconda?

Anaconda free open source is distributing both Python and [R programming language](https://www.guru99.com/r-programming-introduction-basics.html). Anaconda is widely used in the scientific community and data scientist to carry out Machine Learning project or [data analysis](https://www.guru99.com/what-is-data-analysis.html).

## Why use Anaconda?

Anaconda will help you to manage all the libraries required for Python in RStudio, or R. Anaconda will install all the required libraries and IDE into one single folder to simplify package management. Otherwise, you would need to install them separately.

## How to Install RStudio in Anaconda

[![Installing RStudio in Anaconda](https://www.guru99.com/images/r_programming/032818_0958_HowtoDownlo1.png)](https://www.guru99.com/images/r%5Fprogramming/032818%5F0958%5FHowtoDownlo1.png)

Installing RStudio in Anaconda

### How to Install RStudio in Anaconda for Mac

Below are the steps to install RStudio in Anaconda for Mac:

**Step 1) Download Anaconda for Python 3.6 for your OS.**

Go to [https://www.anaconda.com/download/](https://www.anaconda.com/products/individual) and download Anaconda

By default, Chrome selects the downloading page of your system. In this tutorial, Anaconda install RStudio is done for Mac. If you run on Windows or Linux, download Anaconda 5.1 for Windows installer or Anaconda 5.1 for Linux installer.

[](https://www.guru99.com/images/r%5Fprogramming/032818%5F0958%5FHowtoDownlo2.png)

**Step 2) Start Anaconda RStudio installation**

You are now ready to install Anaconda RStudio. Double-click on the downloaded file to begin the installation. It is .dmg for mac and .exe for windows.You will be asked to confirm the installation. Click **Continue** button.

[](https://www.guru99.com/images/r%5Fprogramming/032818%5F0958%5FHowtoDownlo3.png)

You are redirected to the **Anaconda3 Installer**.

[](https://www.guru99.com/images/r%5Fprogramming/032818%5F0958%5FHowtoDownlo4.png)

**Step 3) Continue with installation process**

Next window displays the **ReadMe**. After you are done reading the document, click   **Continue**

[](https://www.guru99.com/images/r%5Fprogramming/032818%5F0958%5FHowtoDownlo5.png)

**Step 4) Read the End User Agreement**

This window shows the RStudio Anaconda End User License Agreement. Click Continue to agree.

[](https://www.guru99.com/images/r%5Fprogramming/032818%5F0958%5FHowtoDownlo6.png)

**Step 5) Click on the Agree button**

You are prompted to agree, click **Agree** to go to the next step.

[](https://www.guru99.com/images/r%5Fprogramming/032818%5F0958%5FHowtoDownlo7.png)

**Step 6) Locate the installation path**

Click **Change Install Location** to set the location of Anaconda. By default, Anaconda is installed in the user environment: **Users/YOURNAME/**.

[](https://www.guru99.com/images/r%5Fprogramming/032818%5F0958%5FHowtoDownlo8.png)

Select the destination by clicking on **Install for me only**. It means Anaconda will be accessible only to this user.

[](https://www.guru99.com/images/r%5Fprogramming/032818%5F0958%5FHowtoDownlo9.png)

**Step 7) Start installing Anaconda**

You can install Conda in R now. Click **Install** to proceed. Anaconda takes around 2.5 GB on your hard drive.

[](https://www.guru99.com/images/r%5Fprogramming/032818%5F0958%5FHowtoDownlo10.png)

A message box is prompt. You need to confirm by typing your password. Hit **Install Software**

[](https://www.guru99.com/images/r%5Fprogramming/032818%5F0958%5FHowtoDownlo11.png)

It may take some time to Install Conda in R. It depends on your machine.

[](https://www.guru99.com/images/r%5Fprogramming/032818%5F0958%5FHowtoDownlo12.png)

**Step 8) Install VS Code if you want**

Anaconda asks you if you want to install Microsoft VSCode. You can ignore it and hit Continue

[](https://www.guru99.com/images/r%5Fprogramming/032818%5F0958%5FHowtoDownlo13.png)

**Step 9) Finish the installation**

The installation is completed. You can close the window.

[](https://www.guru99.com/images/r%5Fprogramming/032818%5F0958%5FHowtoDownlo14.png)

You are asked if you want to move “Anaconda3” installer to the Trash. Click **Move to Trash**

[](https://www.guru99.com/images/r%5Fprogramming/032818%5F0958%5FHowtoDownlo15.png)

**You are done with the installation of Anaconda on a macOS system.**

### RELATED ARTICLES

* [What is R Programming Language? Introduction & Basics of R ](https://www.guru99.com/r-programming-introduction-basics.html "What is R Programming Language? Introduction & Basics of R")
* [IF, ELSE, ELSE IF Statement in R ](https://www.guru99.com/r-if-else-elif-statement.html "IF, ELSE, ELSE IF Statement in R")
* [Scatter Plot in R using ggplot2 (with Example) ](https://www.guru99.com/r-scatter-plot-ggplot2.html "Scatter Plot in R using ggplot2 (with Example)")
* [boxplot() in R: How to Make BoxPlots in RStudio \[Examples\] ](https://www.guru99.com/r-boxplot-tutorial.html "boxplot() in R: How to Make BoxPlots in RStudio [Examples]")

### How to Install RStudio in Anaconda for Windows

Here are the steps to install RStudio in Anaconda for Windows:

**Step 1)** Open the downloaded exe and click Next

[](https://www.guru99.com/images/r%5Fprogramming/032818%5F0958%5FHowtoDownlo16.png)

**Step 2)** Accept the License Agreement

[](https://www.guru99.com/images/r%5Fprogramming/032818%5F0958%5FHowtoDownlo17.png)

**Step 3)** Select Just Me and click Next

[](https://www.guru99.com/images/r%5Fprogramming/032818%5F0958%5FHowtoDownlo18.png)

**Step 4)** Select Destination Folder and Click Next

[](https://www.guru99.com/images/r%5Fprogramming/032818%5F0958%5FHowtoDownlo19.png)

**Step 5)** Click Install in next Screen

[](https://www.guru99.com/images/r%5Fprogramming/032818%5F0958%5FHowtoDownlo20.png)

**Step 6)** Installation will begin

[](https://www.guru99.com/images/r%5Fprogramming/032818%5F0958%5FHowtoDownlo21.png)

**Once done, Anaconda will be installed.** 

## How to Install R

### Install R on Mac

Here is a step by step process to install R on Mac:

**Step 1)** Anaconda uses the **terminal** to install libraries. The terminal is a quick way to install libraries. We need to be sure to point the installation toward the right path. In our case, we set the location of Anaconda to the **Users/USERNAME/**. We can confirm this by checking **anaconda3** folder.

Open **Computer** and select **Users**, **USERNAME** and **anaconda3**. It confirms that we installed Anaconda on the right path. Now, let’s see how macOS write the path. Right-click, and then **Get Info**

[](https://www.guru99.com/images/r%5Fprogramming/032818%5F0958%5FHowtoDownlo22.png)

Select the path **Where** and click **Copy**

[](https://www.guru99.com/images/r%5Fprogramming/032818%5F0958%5FHowtoDownlo23.png)

**Step 2)** For Mac user:

* The shortest way is to use the **Spotlight Search** and write **terminal**.

[](https://www.guru99.com/images/r%5Fprogramming/032818%5F0958%5FHowtoDownlo24.png)

The terminal sets the default working directory to **Users/USERNAME**. As you can see in the figure below, the path of **anaconda3** and the working directory are identical. In macOS, the latest folder is shown before the **$**. For me, it is **Thomas**. The terminal will install all the libraries in this working directory.

If the path on the text editor does not match the working directory, you can change it by writing cd PATH in the terminal. **PATH** is the path you pasted in the text editor. Don’t forget to wrap the PATH with **“PATH”**. This action will change the working directory to **PATH**.

[](https://www.guru99.com/images/r%5Fprogramming/032818%5F0958%5FHowtoDownlo25.png)

**Step 4)** We are ready to install R. I recommend you to install all packages and dependencies with the conda command in the terminal.

## In the terminalconda install r-essentials --yes

r-essentials means conda will install **R** and all the necessary libraries used by data scientist.

[](https://www.guru99.com/images/r%5Fprogramming/032818%5F0958%5FHowtoDownlo26.png)

**Conda** is downloading the libraries

It takes some time to upload all the libraries. Be patient…you are all set.

[](https://www.guru99.com/images/r%5Fprogramming/032818%5F0958%5FHowtoDownlo27.png)

In the terminal, you should see Executing transaction: done. If so, you have successfully installed **R**.

You can check where R is located.

[](https://www.guru99.com/images/r%5Fprogramming/032818%5F0958%5FHowtoDownlo28.png)

### Install R on Windows

Following is a step by step process to install R on Windows:

**Step 1)** Open the Anaconda command prompt

[](https://www.guru99.com/images/r%5Fprogramming/032818%5F0958%5FHowtoDownlo29.png)

**Step 2)** In the command prompt

1. Enter the R install command
2. Environment will be determined
3. List of packages to be installed will be listed

[](https://www.guru99.com/images/r%5Fprogramming/032818%5F0958%5FHowtoDownlo30.png)

**Step 3)** Enter y and hit the return key to start installation

[](https://www.guru99.com/images/r%5Fprogramming/032818%5F0958%5FHowtoDownlo31.png)

**Step 4)** Installation will take time, and you will get done message.

[](https://www.guru99.com/images/r%5Fprogramming/032818%5F0958%5FHowtoDownlo32.png)

## How to Install RStudio

### Mac User

In the terminal, write the following code to install RStudio Anaconda:

## In the terminalconda install -c r rstudio --yes

[](https://www.guru99.com/images/r%5Fprogramming/032818%5F0958%5FHowtoDownlo33.png)

In the terminal, you should see Executing transaction: done. If so, you have successfully installed **Rstudio**.

You are all set now, congratulation!

### Windows User

**Step 1)** Enter command to install RStudio on Anaconda prompt

[](https://www.guru99.com/images/r%5Fprogramming/032818%5F0958%5FHowtoDownlo34.png)

**Step 2)** You will be shown a list of packages that will be installed. Enter y

[](https://www.guru99.com/images/r%5Fprogramming/032818%5F0958%5FHowtoDownlo35.png)

**Step 3)** R Studio will be installed

[](https://www.guru99.com/images/r%5Fprogramming/032818%5F0958%5FHowtoDownlo36.png)

**Warning**

Avoid as much as you can to install RStudio Anaconda library using pip for [Python](https://www.guru99.com/python-tutorials.html), and R. Conda libraries gather a lot of packages, you don’t need to install RStudio on Anaconda prompt libraries outside of conda environment.

## Run Rstudio

Directly run the command line from the terminal to open Rstudio. You open the terminal and write rstudio. You can also use Desktop Shortcut

[](https://www.guru99.com/images/r%5Fprogramming/032818%5F0958%5FHowtoDownlo37.png)

Or

[](https://www.guru99.com/images/r%5Fprogramming/032818%5F0958%5FHowtoDownlo38.png)

A new window will be opened with **Rstudio**.

[](https://www.guru99.com/images/r%5Fprogramming/032818%5F0958%5FHowtoDownlo39.png)

## Test

Open Rstudio from the terminal and open a script. Write the following command:

1. \## In Rstudio **summary**(cars)
2. Click Run
3. Check Output

[](https://www.guru99.com/images/r%5Fprogramming/032818%5F0958%5FHowtoDownlo40.png)

If you can see the summary statistics, it works. You can close Rstudio without saving the files.

## Install package

Install package with anaconda is trivial. You go to your favorite browser, type the name of the library followed by **anaconda r**.

[](https://www.guru99.com/images/r%5Fprogramming/032818%5F0958%5FHowtoDownlo41.png)

You choose the link that points to anaconda. You copy and paste the library into the terminal.

[](https://www.guru99.com/images/r%5Fprogramming/032818%5F0958%5FHowtoDownlo42.png)

For instance, we need to install randomForest for the tutorial on random forest; we go <https://anaconda.org/r/r-randomforest>.

[](https://www.guru99.com/images/r%5Fprogramming/032818%5F0958%5FHowtoDownlo43.png)

Run conda install -c r r-randomforest –yes from the terminal.

[](https://www.guru99.com/images/r%5Fprogramming/032818%5F0958%5FHowtoDownlo44.png)

The installation is completed.

Note that Thorough this tutorial, you won’t need to install many libraries as the most used libraries came with the r-essential conda library. It includes ggplot for the graph and caret for the [machine learning project](https://www.guru99.com/machine-learning-tutorial.html).

## Open a library

To run the [R function](https://www.guru99.com/r-functions-programming.html) randomForest(), we need to open the library containing the function. In the Rstudio script, we can write library(randomForest)

## In Rstudiolibrary(randomForest)	
## randomForest 4.6-12	
## Type rfNews() to see new features/changes/bug fixes.	

**Warning:** Avoid as much as possible to open unnecessary packages. You might ended up creating conflicts between libraries.

## Run R code

We have two ways to run codes in R

1. We can run the codes inside the Console. Our data will be stored in the Global Environment but no history is recorded. We won’t be able to replicate the results once R is closed. We need to write the codes all over again. This method is not recommended if we want to replicate our save our codes

[](https://www.guru99.com/images/r%5Fprogramming/032818%5F0958%5FHowtoDownlo45.png)

1. Write the code in the script. We can write as many lines of codes as we want. To run the code, we simple select the rows we want to return. Finally, click on run. We can see the output in the Console. We can save our script and open it later. Our results won’t we lost.

[](https://www.guru99.com/images/r%5Fprogramming/032818%5F0958%5FHowtoDownlo46.png)

**Warning**: In we point the cursor at the second row (i.e., slice\_vector\[1:5\]), the Console displays an error. That’s, we didn’t run the line number 1.

[](https://www.guru99.com/images/r%5Fprogramming/032818%5F0958%5FHowtoDownlo47.png)

Similarly, if we point the cursor to an empty row and click on run, [R](https://www.guru99.com/r-tutorial.html) return an empty output.

[](https://www.guru99.com/images/r%5Fprogramming/032818%5F0958%5FHowtoDownlo48.png)

#### Summarize this post with:

ChatGPT Perplexity Grok Google AI 

**Stay Updated on AI** **Get Weekly AI Skills, Trends, Actionable Advice.** 

##### Sign up for the newsletter

Subscribe for Free 

You have successfully subscribed.  
Please check your inbox. 

![AI-Newsletter]() Chosen by over **350,000+** professionals 

[Scroll to top ](#wrapper)Scroll to top 

× 

Toggle Menu Close 

Search for: 

Search

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://www.guru99.com/#organization","name":"Guru99","sameAs":["https://www.facebook.com/Guru99Official","https://twitter.com/guru99com"],"logo":{"@type":"ImageObject","@id":"https://www.guru99.com/#logo","url":"https://www.guru99.com/images/guru99-logo-v1-150x59.png","contentUrl":"https://www.guru99.com/images/guru99-logo-v1-150x59.png","caption":"Guru99","inLanguage":"en-US"}},{"@type":"WebSite","@id":"https://www.guru99.com/#website","url":"https://www.guru99.com","name":"Guru99","publisher":{"@id":"https://www.guru99.com/#organization"},"inLanguage":"en-US"},{"@type":"ImageObject","@id":"https://www.guru99.com/images/download-install-r-rstudio.png","url":"https://www.guru99.com/images/download-install-r-rstudio.png","width":"325","height":"55","inLanguage":"en-US"},{"@type":"BreadcrumbList","@id":"https://www.guru99.com/download-install-r-rstudio.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":"1","item":{"@id":"https://www.guru99.com","name":"Home"}},{"@type":"ListItem","position":"2","item":{"@id":"https://www.guru99.com/r-programming","name":"R Programming"}},{"@type":"ListItem","position":"3","item":{"@id":"https://www.guru99.com/download-install-r-rstudio.html","name":"How to Download &#038; Install RStudio in Anaconda [Windows/Mac]"}}]},{"@type":"WebPage","@id":"https://www.guru99.com/download-install-r-rstudio.html#webpage","url":"https://www.guru99.com/download-install-r-rstudio.html","name":"How to Download &#038; Install RStudio in Anaconda [Windows/Mac]","dateModified":"2024-06-12T19:11:08+05:30","isPartOf":{"@id":"https://www.guru99.com/#website"},"primaryImageOfPage":{"@id":"https://www.guru99.com/images/download-install-r-rstudio.png"},"inLanguage":"en-US","breadcrumb":{"@id":"https://www.guru99.com/download-install-r-rstudio.html#breadcrumb"}},{"@type":"Person","@id":"https://www.guru99.com/author/evelyn","name":"Evelyn Clarke","description":"I'm Evelyn Clarke, an AI Research Scientist specializing in machine learning and natural language processing, dedicated to advancing the field responsibly.","url":"https://www.guru99.com/author/evelyn","image":{"@type":"ImageObject","@id":"https://www.guru99.com/images/evelyn-clarke-author-120x120.png","url":"https://www.guru99.com/images/evelyn-clarke-author-120x120.png","caption":"Evelyn Clarke","inLanguage":"en-US"},"worksFor":{"@id":"https://www.guru99.com/#organization"}},{"image":{"@id":"https://www.guru99.com/images/download-install-r-rstudio.png"},"headline":"How to Download &#038; Install RStudio in Anaconda [Windows/Mac]","description":"In this tutorial, you will learn How to Download and Install RStudio in Anaconda for Mac &amp; Windows, Install R on Mac &amp; Windows, and test R scripts.","keywords":"R, Programming","@type":"Article","author":{"@id":"https://www.guru99.com/author/evelyn","name":"Evelyn Clarke"},"dateModified":"2024-06-12T19:11:08+05:30","copyrightYear":"2024","name":"How to Download &#038; Install RStudio in Anaconda [Windows/Mac]","articleSection":"R Programming","subjectOf":[{"@type":"HowTo","name":"How to Install RStudio in Anaconda","description":"Below are the steps to install RStudio in Anaconda for Mac:","step":[{"@type":"HowToStep","name":"Step 1) Download Anaconda for Python 3.6 for your OS.","text":"Go to https://www.anaconda.com/download/ and download Anaconda","image":"https://cdn.guru99.com/images/r_programming/032818_0958_HowtoDownlo2.png","url":"https://www.guru99.com/download-install-r-rstudio.html#step1"},{"@type":"HowToStep","name":"Step 2) Start Anaconda RStudio installation","text":"You are now ready to install Anaconda RStudio. Double-click on the downloaded file to begin the installation.","image":"https://cdn.guru99.com/images/r_programming/032818_0958_HowtoDownlo3.png","url":"https://www.guru99.com/download-install-r-rstudio.html#step2"},{"@type":"HowToStep","name":"Step 3) Continue with installation process","text":"Next window displays the ReadMe. After you are done reading the document, click Continue","image":"https://cdn.guru99.com/images/r_programming/032818_0958_HowtoDownlo5.png","url":"https://www.guru99.com/download-install-r-rstudio.html#step3"},{"@type":"HowToStep","name":"Step 4) Read the End User Agreement","text":"This window shows the RStudio Anaconda End User License Agreement. Click Continue to agree.","image":"https://cdn.guru99.com/images/r_programming/032818_0958_HowtoDownlo6.png","url":"https://www.guru99.com/download-install-r-rstudio.html#step4"},{"@type":"HowToStep","name":"Step 5) Click on the Agree button","text":"You are prompted to agree, click Agree to go to the next step.","image":"https://cdn.guru99.com/images/r_programming/032818_0958_HowtoDownlo7.png","url":"https://www.guru99.com/download-install-r-rstudio.html#step5"},{"@type":"HowToStep","name":"Step 6) Locate the installation path","text":"Click Change Install Location to set the location of Anaconda.","image":"https://cdn.guru99.com/images/r_programming/032818_0958_HowtoDownlo8.png","url":"https://www.guru99.com/download-install-r-rstudio.html#step6"},{"@type":"HowToStep","name":"Step 7) Start installing Anaconda","text":"You can install Conda in R now. Click Install to proceed. Anaconda takes around 2.5 GB on your hard drive.","image":"https://cdn.guru99.com/images/r_programming/032818_0958_HowtoDownlo10.png","url":"https://www.guru99.com/download-install-r-rstudio.html#step7"},{"@type":"HowToStep","name":"Step 8)  Install VS Code if you want","text":"Anaconda asks you if you want to install Microsoft VSCode. You can ignore it and hit Continue","image":"https://cdn.guru99.com/images/r_programming/032818_0958_HowtoDownlo13.png","url":"https://www.guru99.com/download-install-r-rstudio.html#step8"},{"@type":"HowToStep","name":"Step 9) Finish the installation","text":"The installation is completed. You can close the window.","image":"https://cdn.guru99.com/images/r_programming/032818_0958_HowtoDownlo14.png","url":"https://www.guru99.com/download-install-r-rstudio.html#step9"}]}],"@id":"https://www.guru99.com/download-install-r-rstudio.html#schema-30800","isPartOf":{"@id":"https://www.guru99.com/download-install-r-rstudio.html#webpage"},"publisher":{"@id":"https://www.guru99.com/#organization"},"inLanguage":"en-US","mainEntityOfPage":{"@id":"https://www.guru99.com/download-install-r-rstudio.html#webpage"}}]}
```
