---
author: Christian Ayala
title: Putting R in your system path
---
# Putting R in your system's `PATH` environmental variable (Windows)
#### By Christian Ayala, University of Arizona
## A. Locate the directory containing R executables
1. Search for **Rscript** in the search box of Windows.
2. Select **Rscript** -> **Open file location** (see figure below).

You should arrive to a directory that contains several executables including **Rgui**, **Rscript** and **Rcmd**.
3. Click on the **address bar** and copy the **path** to this directory.

## B. Adding R directory to your system's path
4. Search for **environment variables** in the search box of Windows.
5. Select **Edit the system environment variables** -> **Open**.

6. Click **Environment Varibles**.

7. Select **Path** and click on **Edit...**.

8. (Optional) If you have the path of and **older version** of R that you are not using anymore **select it** and click on **Delete**.

9. Click on **New** and paste the path to the R directory folder that you copied earlier (**Step 3**). Then click **OK** on all open Windows.


## C. Test that R has been added to your `PATH` environmental variable.
10. Open **Anaconda Prompt** terminal and type:
```
which Rscript
```
If it returns the path to the folder that contains the executables (the one that you arrived on **Step 2**).

If it returns an error, please check again that you are adding the R executables folder to your path correctly.
# Questions or comments
Please do not hesitate to reach me at: cayalaortiz@arizona.edu