Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use R with Google Colaboratory?

Google Colaboratory supports Python version 2.7 and 3.6

I saw an example how to use Swift in Colab a while ago.

Today, I happened to run

!jupyter-kernelspec list 

And found a new kernel: IRkernel

Available kernels:   ir         /usr/local/share/jupyter/kernels/ir   python2    /usr/local/share/jupyter/kernels/python2   python3    /usr/local/share/jupyter/kernels/python3   swift      /usr/local/share/jupyter/kernels/swift 

Is it now possible to use R in Colab as well? No hassle in installing R kernel?

like image 308
korakot Avatar asked Feb 08 '19 15:02

korakot


People also ask

Can you code in Google Colab?

The Google Colaboratory (“Colab”) is a notebook (like a Jupyter Notebook) where you can run Python code in your Google Drive. You can write text, write code, run that code, and see the output – all in line in the same notebook.

Can we use Google colab for machine learning?

Have you ever wanted an easy-to-configure interactive environment to run your machine learning code that came with access to GPUs for free? Google Colab is the answer you've been looking for.

Can I use Jupyter Notebook for R?

The Jupyter Notebook is a Web application which permits to create live code in different languages. Usually, developers exploit the Jupyter Notebook to write code in Python. However, Jupyter also supports other programming languages, including Java, R, Julia, Matlab, Octave, Scheme, Processing, Scala and many others.


1 Answers

Yes.

For a new R-notebook, use this link. (shorthand is colab.to/r )

You can learn from IRkernel demos, e.g. demo.ipynb

Save a copy in your Google Drive, and make any changes you need.

2 more demos:

  • Display.ipynb shows how to display HTML, images.
  • Comm_Demo.ipynb shows how to communicate between R and JavaScript.

See more details in IRkernel Github.

like image 104
korakot Avatar answered Oct 04 '22 22:10

korakot