How to use R on Google Colab without extensions

Any installation is not required

Shiro Matsumoto
3 min readOct 23, 2023

There are already a few instructions on how to use R on Google Collaboratory on Medium. Still, I will show you how to use R on Google Collaboratory without installing anything.

1. Create a New notebook

On the Google colaboratory page, select Create a + New notebook.

Picture by author

2. Download .ipynb

From the File menu, select Download → Download .ipynb to download the notebook.

Picture by author

3. Edit Notebook

Edit the downloaded ipynb file using Notepad or other applications.
The following two sections are to be rewritten.

Picture by author

4. Upload notebook file

Select Upload notebook from the File menu and upload the notebook file you edited.

Picture by author

5. Check runtime

Select Change runtime type from the Runtime menu to display the currently selected runtime. If the Runtime type is set to R, confirmation is complete. R will run in this notebook.

Once you have completed setting up the R runtime, you only need to create a new notebook and select R as the runtime the next time. There is no need to repeat the above procedures 1–4.

Picture by author
Picture by author

6. R version

At the time of writing, the version of R is R4.3.1.

Picture by author

7. Installed libraries

The notebook already has several libraries installed, as can be seen.

Picture by author

8. Inconvenience compared with python

With the Python 3 runtime, the list of variables can be displayed from the left pane, but the list of variables cannot be displayed with the R runtime.

Picture by author
Picture by author

--

--

Shiro Matsumoto
Shiro Matsumoto

Written by Shiro Matsumoto

Here's something that hasn't been written yet and isn't a copy and paste. Data Scientist in Washington, DC

No responses yet