Go back

R development using Jupyter

This section explains you how to use Jupyter for R-Development.

  1. Once the VM is up and running, SSH to VM and run below command to set the password for ubuntu user.
sudo passwd ubuntu

/img/gcp/r-studio-support/ssh-passwd.png

  1. To access jupyter go to http://VM_Public_IP . Login using ubuntu user and provide password set in the above step.

/img/common/jupyterhub_signin.png

  1. This will log you as an ubuntu user to the jupyter notebook.

/img/gcp/r-studio-support/jupyter_home_page.png

  1. You can create new R Notebooks and run your code. To create new Notebook, click on New and select R from dropdown menu.

/img/gcp/r-studio-support/r-jupyter-new-notebook.png

  1. It will create untitled Notebook in new tab. Click on Untitled to rename this Notebook

/img/gcp/r-studio-support/rename-untitled-notebook.png

  1. Write your code in the cell.To run the code, select the cell then select Run or use the keyboard shortcut CTRL+ENTR

/img/gcp/r-studio-support/running-r-cell.png

  1. Let’s display iris table with the library(dplyr)

/img/gcp/r-studio-support/display-iris-table.png

  1. We can create scatter plot using ggplot2 library.

/img/gcp/r-studio-support/scatter-plot.png

  1. You have different option to stop, restart, run all, shutdown kernel in the kernel dropdown menu.

/img/gcp/r-studio-support/kernel-option.png

  1. asterisk (*) in any cell shows that cell is running. Solid cirlce next to R shows that kernel is busy.

/img/gcp/r-studio-support/kernel-running.png

This way you can create your own R Notebooks in jupyter and run the code.

Go back