Skip to content

Commit 8df3150

Browse files
authored
Update how-to-access-terminal.md
1 parent f3d0283 commit 8df3150

File tree

1 file changed

+35
-1
lines changed

1 file changed

+35
-1
lines changed

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

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,41 @@ To add a new Jupyter kernel to the compute instance:
104104

105105
Any of the [available Jupyter Kernels](https://github.com/jupyter/jupyter/wiki/Jupyter-kernels) can be installed.
106106

107-
To create new R kernels, use the `IRkernel` package in R. If you create the new kernel from within a notebook, close the notebook and reopen it to see the new kernel. For more information about IRkernel, see [Native R kernel for Jupyter](https://cran.r-project.org/web/packages/IRkernel/readme/README.html).
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, install and 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).
108142
109143
### Remove added kernels
110144

0 commit comments

Comments
 (0)