Giter Site home page Giter Site logo

irkernel's Introduction

Native R kernel for IPython

This is still experimental. Your code should be safe, since IPython handles saving and loading notebooks in another process, but you'll lose all your variables if it crashes.

Requirements

To run IPython with an R kernel, you need at least the following:

  • IPython, version 3.0 or later. If you already have a Python environment set up, install IPython using your preferred tools. If not, installing Anaconda is the quickest way to get everything you need. Earlier versions of IPython are now unsupported.
  • A current R installation.

Installing from source needs additionally header files (see below).

Installing via supplied binary packages (Windows + Mac OS X)

We provide Windows and Mac OS X binary packages of all the needed packages. The packages and the kernel spec can be installed for the current user with the following lines in an R console:

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

To install system-wide, set user to False in the installspec command:

IRkernel::installspec(user = FALSE)

To update packages, you have to either add the repo to your default ones in your R startup file and update afterwards as normal:

r <- getOption('repos')
r$IRkernel <- 'http://irkernel.github.io/'
options(repos = r)

Or use the repo option to update.packages() directly:

update.packages(repos = c('http://irkernel.github.io/', getOption('repos')))

Please note that during the initial development, these packages can be updated without changing the version number, which prevents updating via update.packages(). In that case, updated packages can be installed by re-running the above install.packages() line.

Installing from source (Default on Linux, but possible on all platforms)

ZMQ

You'll need zmq development headers to compile rzmq.

  • Ubuntu/Debian

    sudo apt-get install libzmq3-dev
  • Arch

    sudo pacman -S zeromq
  • Homebrew

    xcode-select --install
    brew install zmq
    # or upgrade
    brew update
    brew upgrade zmq
  • MacPorts

    1. make sure an X server is installed, open a terminal and do the following:

      xcode-select --install
      sudo port install zmq
    2. Direct the compiler to use MacPorts libraries using:

      export CPATH=/opt/local/include
      export LIBRARY_PATH=/opt/local/lib
  • Windows

    See this bugreport for instruction on how to compile on windows.

R

Start R in the same terminal, and proceed as below.

You can install snapshot packages and the kernel spec via

install.packages(c('rzmq','repr','IRkernel','IRdisplay'),
                 repos = c('http://irkernel.github.io/', getOption('repos')),
                 type = 'source')
IRkernel::installspec()

To update your source installation, repeat the install.packages step.

Development Version

If you want to compile the latest and greatest (and maybe buggiest…) from git, the easiest way is via the devtools package.

On Ubuntu/Debian, a header package is needed to compile RCurl:

sudo apt-get install libcurl4-openssl-dev

Start a R session and run:

install.packages('devtools')
# Need RCurl for install_github
install.packages('RCurl')
library(devtools)
# Install the packages
install_github('IRkernel/repr')
install_github('IRkernel/IRdisplay')
install_github('IRkernel/IRkernel')
# Install the kernel spec
IRkernel::installspec()

To update the git versions, repeat the install_github('IRkernel/...') steps.

Running the notebook

If you have IPython 3.0 installed, you can create a notebook and switch to IRkernel from the dropdown menu.

You can also start a qtconsole with an R kernel:

# “ir” is the kernel name installed by the above 'IRkernel::installspec()'
ipython qtconsole --kernel=ir

You can also substitute console for qtconsole in this command.

irkernel's People

Contributors

abielr avatar benmarwick avatar chendaniely avatar djsutherland avatar flying-sheep avatar fperez avatar ihrke avatar jankatins avatar jeroen avatar karthik avatar mariusbutuc avatar matthieugomez avatar mikecroucher avatar minrk avatar randy3k avatar rgbkrk avatar szhorvat avatar takluyver avatar willwhitney avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.