GithubHelp home page GithubHelp logo

facebookexperimental / rmdkernel Goto Github PK

View Code? Open in Web Editor NEW
2.0 22.0 1.0 747 KB

This is a very simple fork of https//github.com/IRkernel/IRkernel to provide an rmarkdown (rather than R) jupyter kernel.

License: Other

Makefile 0.71% R 42.10% Jupyter Notebook 46.27% JavaScript 1.45% Python 9.48%

rmdkernel's Introduction

Native Rmarkdown kernel for Jupyter ![b-CI] b-CRAN

LICENSE: MIT

Requirements

Installation

This package is not available on CRAN. You can install with remotes:

remote::instal_github('facebookexperimental/Rmdkernel')
Rmdkernel::installspec()  # to register the kernel in the current R installation

Per default Rmdkernel::installspec() will install a kernel with the name “rmarkdown” and a display name of “Rmarkdown”. Multiple calls will overwrite the kernel with a kernel spec pointing to the last R interpreter you called that commands from. You can install kernels for multiple versions of R by supplying a name and displayname argument to the installspec() call (You still need to install these packages in all interpreters you want to run as a jupyter kernel!):

# in R 3.3
Rmdkernel::installspec(name = 'rmd33', displayname = 'R 3.3')
# in R 3.2
Rmdkernel::installspec(name = 'rmd32', displayname = 'R 3.2')

By default, it installs the kernel per-user. To install system-wide, use user = FALSE. To install in the sys.prefix of the currently detected jupyter command line utility, use sys_prefix = TRUE.

Now both R versions are available as an Rmarkdown kernel in the notebook.

Running the notebook

If you have Jupyter installed, you can create a notebook using Rmdkernel from the dropdown menu.

You can also start other interfaces with an R kernel:

# “rmarkdown” is the kernel name installed by the above `Rmdkernel::installspec()`
# change if you used a different name!
jupyter qtconsole --kernel=rmarkdown
jupyter console --kernel=rmarkdown

How does it know where to install?

The Rmdkernel does not have any Python dependencies whatsoever, and does not know anything about any other Jupyter/Python installations you may have. It only requires the jupyter command to be available on $PATH. To install the kernel, it prepares a kernelspec directory (containing kernel.json and so on), and passes it to the command line jupyter kernelspec install [options] prepared_kernel_dir/, where options such as --name, --user, --prefix, and --sys-prefix are given based on the options.

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.