R Kernel in Jupyter: Update

I was using my own  article “A R kernel in IPython notebook: Jupyter“, to install both Jupyter and the IRKernel on a small ASUS Eee PC Seashell 12” laptop that I use when we are on holidays. This runs Kubuntu, as most of the PCs in my household. Unfortunately the instructions I provided in July are no longer working, to get it both installed and running  I went through a painful process but eventually everything in the end turned out OK. I proceeded step by step and I started by installing Jupiter.  I used the instructions at the Jupyter web site, and as I have Python 2.7 installed, (you need 2.7 or 3), I decided to go for the “pip” way:

  • sudo apt-get install python-pip
  • sudo pip install jupyter

Next thing to do was to install the R Kernel. I first updated my installation to the most recent version of R (3.2.3). The installation of the IRKernel requires several libraries to be installed and I may have installed some that are not strictly necessary in the process. The instructions can be found on the new web site of the IRKernel. Some of the libraries have been installed because the instructions to install libraries in R failed and I tried to provide the missing “ground to the installations” by googling and looking at stackoverflow.com posts:

  •  sudo apt-get install libzmq3-dev libcurl4-openssl-dev
  • sudo apt-get install libcurl4-gnutls-dev
  • sudo apt-get install git2cl
  • udo  apt-get install libssl-dev/unstable
  • sudo  apt-get install libssl-dev
  • sudo apt-get install -t unstable libgdal-dev
  • sudo apt-get install libgdal-dev
  • sudo apt-get install libxml2-dev
  • sudo apt-get install libcurl4-openssl-dev
  • sudo apt-get install libcairo2 libgtk2.0-dev libcairo2-dev xvfb xauth xfonts-base
  • sudo apt-get install libxt-dev

Only after these were installed I could finally follow the final part of the  instructions, to be executed in R:

  • install.packages(c(‘rzmq’,’repr’,’IRkernel’,’IRdisplay’),
    repos = c(‘http://irkernel.github.io/’, getOption(‘repos’)))
  • IRkernel::installspec()

Not all of these worked, so I had to download some of the dependency packages and install from file. This was tedious as some more packages needed to be downloaded but not too long to be a show-stopper. Some of the libraries mentioned above were needed in order to  install the IRKernel, so you may have an easier life. To launch the jupyter with a R kernel:

  • jupyter notebook
  • From the web page that opens, select the”New” combo button  and choose “R”

Enjoy!