Skip to content

Commit c1ec769

Browse files
Merge pull request #262028 from sdgilley/patch-10
Add info on R kernels
2 parents d8c92df + 51bccfc commit c1ec769

File tree

1 file changed

+37
-1
lines changed

1 file changed

+37
-1
lines changed

articles/machine-learning/how-to-access-terminal.md

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,43 @@ To add a new Jupyter kernel to the compute instance:
102102
python -m ipykernel install --user --name newenv --display-name "Python (newenv)"
103103
```
104104

105-
Any of the [available Jupyter Kernels](https://github.com/jupyter/jupyter/wiki/Jupyter-kernels) can be installed.
105+
Any of the [available Jupyter Kernels](https://github.com/jupyter/jupyter/wiki/Jupyter-kernels) can be installed.
106+
107+
To add a new R kernel to the compute instance:
108+
109+
1. Use the terminal window to create a new environment. For example, the code below creates `r_env`:
110+
111+
```shell
112+
conda create -n r_env r-essentials r-base
113+
```
114+
115+
1. Activate the environment. For example, after creating `r_env`:
116+
117+
```shell
118+
conda activate r_env
119+
```
120+
121+
1. Run R in the new environment:
122+
123+
```
124+
R
125+
```
126+
127+
1. At the R prompt, run `IRkernel`:
128+
129+
```
130+
IRkernel::installspec(name = 'irenv', displayname = 'New R Env')
131+
```
132+
133+
1. Quit the R session.
134+
135+
```
136+
q()
137+
```
138+
139+
It will take a few minutes before the new R kernel is ready to use. If you get an error saying it is invalid, wait and then try again.
140+
141+
For more information about conda, see [Using R language with Anaconda](https://docs.anaconda.com/free/anaconda/packages/using-r-language/). For more information about IRkernel, see [Native R kernel for Jupyter](https://cran.r-project.org/web/packages/IRkernel/readme/README.html).
106142
107143
### Remove added kernels
108144

0 commit comments

Comments
 (0)