Today i will teach you How to Add R to Jupyter Notebook
You can add R to Jupyter Notebook by typing this command in the Anaconda Prompt:
conda install -c r r-irkernel
But just in case you were wondering, here are the full steps to add R to Jupyter Notebook from scratch.
Steps to Add R to Jupyter Notebook
Step 1: Open the Anaconda Prompt
To start, open the Anaconda Prompt:
![](https://datapott.com/wp-content/uploads/2021/05/001_add_r_to_jupyter-1.png)
You’ll then see the following screen with your user name:
![](https://datapott.com/wp-content/uploads/2021/05/002_add_r_to_jupyter.png)
Step 2: Add R to Jupyter
Next, type/copy the following command in order to add R to Jupyter:
conda install -c r r-irkernel
The command would look like this in the Anaconda Prompt (press ENTER to proceed with the installation):
![](https://datapott.com/wp-content/uploads/2021/05/003_add_r_to_jupyter.png)
You’ll eventually see the following:
![](https://datapott.com/wp-content/uploads/2021/05/007_add_r_to_jupyter.png)
Type ‘y‘ and then press ENTER to proceed:
![](https://datapott.com/wp-content/uploads/2021/05/008_add_r_to_jupyter.png)
After a short period of time your installation will be completed:
![](https://datapott.com/wp-content/uploads/2021/05/009_add_r_to_jupyter-1.png)
Step 3: Launch Jupyter Notebook
To launch Jupyter Notebook, first open the Anaconda Navigator:
![](https://datapott.com/wp-content/uploads/2021/05/010_add_r_to_jupyter-2.png)
Then, click on the button to launch Jupyter:
![](https://datapott.com/wp-content/uploads/2021/05/011_add_r_to_jupyter.png)
Next, click on ‘New’ on the top right-hand-side of your screen:
![](https://datapott.com/wp-content/uploads/2021/05/012_add_r_to_jupyter.png)
Finally, select ‘R’ from the drop-down list:
![](https://datapott.com/wp-content/uploads/2021/05/013_add_r_to_jupyter.png)
You’ll then see the following screen where you can type your code:
![](https://datapott.com/wp-content/uploads/2021/05/014_add_r_to_jupyter.png)
Step 4: Run your Code
You can now run your desired R code.
For example, you can create a simple DataFrame in R using this syntax:
df <- data.frame(name = c('Jon', 'Bill', 'Maria'),
age = c(23, 41, 32)
)
print (df)
This is how the syntax would look in Jupyter Notebook:
![](https://datapott.com/wp-content/uploads/2021/05/015_add_r_to_jupyter.png)
Click on ‘Run’ and you’ll then get the following DataFrame:
![](https://datapott.com/wp-content/uploads/2021/05/016_add_r_to_jupyter.png)