Using the R programming language in Jupyter NotebookΒΆ
R is a popular programing language for statistics.
To install and run R in a Jupyter Notebook:
To install the R language and r-essentials packages, follow the instructions in Finding and installing a package.
NOTE: These packages are available in the MRO channel, which you may need to add to your channels list.
Open the environment with the R package using the Open with Jupyter Notebook option.
To create a new notebook for the R language, in the Jupyter Notebook menu, select New, then select R.
Copy and paste the following code into the first cell:
library(dplyr) iris
To run the code, in the menu bar, click Cell then select Run Cells, or use the keyboard shortcut Ctrl-Enter.
The iris data table is displayed.
To plot the data, click + to open a second cell, then copy and paste the following code into the second cell:
library(ggplot2) ggplot(data=iris, aes(x=Sepal.Length, y=Sepal.Width, color=Species)) + geom_point(size=3)
To run the code, in the menu bar, click Cell then select Run Cells, or use the keyboard shortcut Ctrl-Enter.
For more resources on using R with Anaconda, see Using R language with Anaconda.
TIP: For more information and to see the example code, see the Anaconda Developer Blog.