free stats

Install R Programming Language to Jupyter Notebook

Last Update : 24 Dec, 2022 R Programming Tutorials

In this tutorial, you will learn how to install R programming language to Jupyter Notebook. and how to run a simple R script using Jupyter Notebook.

The simplest way to install the R programming language to Jupyter Notebook is by typing the following command in the Anaconda Prompt.

conda install -c r r-irkernel

But if you need to install the R programming language to Jupyter Notebook from scratch, You can follow the following guide for that.

 

Steps to install R programming language to Jupyter Notebook

 

Step 01: Open the Anaconda Prompt

First, open the Anaconda Prompt to prepare the installation process. Then, you will see the following screen with your PC user name.

(base) C:\Users\PC_User_Name>

 

Step 02: Install R programming language to Jupyter Notebook

Now you can type or copy the following command in order to install R to Jupyter Notebook.

conda install -c r r-irkernel

When you enter the above command in the Anaconda Prompt, it looks as follows. Now press the ENTER button to proceed with the installation process.

(base) C:\Users\PC_User_Name>conda install -c r r-irkernel

Then, type the "y" letter and then press the ENTER button to proceed.

Proceed ([y]/n)? y

You can see that your installation has been completed after a short period of time.

 

Step 03: Open Jupyter Notebook

First, you need to open the Anaconda Navigator to open Jupyter Notebook. Then, click on the launch button to open Jupyter Notebook.

 

Step 04: Create a new Notebook

First, click on "New" on the top right-hand side of your screen. and, Then, select "R" from the drop-down list to create a new Notebook for R script writing.

 

Step 05: Run your R script code

This is the best time to run your R script using Jupyter Notebook. For that, create a simple DataFrame in R script by using the following syntax as an example.

company <- data.frame(department = c('Marketing', 'Accounting', 'HR'), employee = c(50, 33, 239))
print(company)

Now click on "Run". Then you will see the following DataFrame output.

  department employee
1  Marketing       50
2 Accounting       33
3         HR      239

 

You found this tutorial / article valuable? Need to show your appreciation? Here are some options:

01. Spread the word! Use following buttons to share this tutorial / article link on your favorite social media sites.

02. Follow us on Twitter, GitHub ,and Facebook.