Data Science Workshop (DSW) of Platform for AI (PAI) is integrated with open source JupyterLab. You can install R Kernel on a DSW instance by using conda. Then, you can use R script in Notebook to train models. This topic describes how to install R Kernel on a DSW instance.
Prerequisites
A DSW instance is created. For more information, see Create a DSW instance.
Procedure
Go to the development environment of Data Science Workshop (DSW).
Log on to the PAI console.
In the left-side navigation pane, click Workspaces. On the Workspaces page, click the name of the workspace that you want to manage.
In the upper-left corner of the page, select the region where you want to use PAI.
In the left-side navigation pane, choose .
(Optional.) On the Interactive Modeling (DSW) page, enter the name of a DSW instance or a keyword in the search box to search for the DSW instance.
Find the DSW instance and click Launch in the Actions column.
On the Launcher tab, click Terminal in the Text and terminal section.
Run the following code to create and install R Kernel:
conda create -n r-kernel source activate r-kernel conda install r-recommended r-irkernel conda install Jupyter R -e 'IRkernel::installspec()' jupyter-notebook
NoteWe recommend that you write and execute the code by line.
If the Proceed ([y]/n) message appears during code execution, enter y and then press the Enter key.
If the
conda:not found
error message appears when you run the following command, conda is not installed in the image environment. You must install conda on the DSW instance by running the following command:$ wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh $ bash Miniconda3-latest-Linux-x86_64.sh $ source ~/.bashrc
Go back to the Launcher tab to check whether the R environment is available.
If the R environment is available, you can use the R programming language in the Notebook of the instance.