Package 'IRkernel'

Title: Native R Kernel for the 'Jupyter Notebook'
Description: The R kernel for the 'Jupyter' environment executes R code which the front-end ('Jupyter Notebook' or other front-ends) submits to the kernel via the network.
Authors: Thomas Kluyver [aut, cph], Philipp Angerer [aut, cph, cre] , Jan Schulz [aut, cph], Karthik Ram [aut, cph]
Maintainer: Philipp Angerer <[email protected]>
License: MIT + file LICENSE
Version: 1.3.2.9000
Built: 2024-06-28 04:46:57 UTC
Source: https://github.com/irkernel/irkernel

Help Index


Get global CommManager instance

Description

Get global CommManager instance

Usage

comm_manager()

Value

CommManager instance if a kernel is running, else NULL


The Comm

Description

Has methods able to register and handle message callbacks


The CommManager

Description

Has methods able to register comms/targets and process comm messages


Install the kernelspec to tell Jupyter about IRkernel.

Description

This can be called multiple times for different R interpreter, but you have to give a different name (and displayname to see a difference in the notebook UI). If the same name is give, it will overwrite older versions of the kernel spec with that name!

Usage

installspec(
  user = NULL,
  name = "ir",
  displayname = "R",
  rprofile = NULL,
  prefix = NULL,
  sys_prefix = NULL,
  verbose = getOption("verbose"),
  env = NULL
)

Arguments

user

Install into user directory ($XDG_DATA_HOME/jupyter/kernels) or globally? (default: NULL but treated as TRUE if "prefix" is not specified)

name

The name of the kernel (default "ir")

displayname

The name which is displayed in the notebook (default: "R")

rprofile

(optional) Path to kernel-specific Rprofile (defaults to system-level settings)

prefix

(optional) Path to alternate directory to install kernelspec into (default: NULL)

sys_prefix

(optional) Install kernelspec using the --sys-prefix option of the currently detected jupyter (default: NULL)

verbose

(optional) If FALSE, silence output of install

env

(optional) Named list of environment variables to set in the kernel (default: NULL)

Value

Exit code of the jupyter kernelspec install call.


An R kernel for Jupyter.

Description

Jupyter speaks a JSON+ZMQ protocol to a 'kernel' which is responsible for executing code. This package is a kernel for the R language.

Usage

jupyter_option_defaults

Format

An object of class list of length 7.

Options

The following can be set/read via options(opt.name = ...) / getOption('opt.name')

jupyter.log_level

1L (errors), 2L (warnings), or 3L (debug). 1L is the default.

jupyter.pager_classes

Classes to use the pager for instead of displaying them inline. Default: help pages

jupyter.in_kernel

TRUE if this code is executed in a running kernel. Set to pretend being/not being in a kernel

jupyter.rich_display

Use more than just text display

jupyter.display_mimetypes

The formats emitted when any return value is to be displayed (default: all mimetypes listed here)

jupyter.plot_mimetypes

The plot formats emitted to the frontend when a plot is displayed. (default: image/png and application/pdf)

jupyter.plot_scale

The ratio (notebook PPI / repr.plot.res). E.g.: With the defaults repr.plot.res=120 px/in (PPI) and jupyter.plot_scale=2, a 1in×\times1in image will be displayed as a 0.5in×\times0.5in, 240 PPI image. (default: 2, fit for retina displays)

See Also

installspec


Kernel logging functions

Description

A set of exported logging utilities that have the capability to be used in upstream projects. Log level and log file can be set via R package options e.g. options(jupyter.log_level = 2L) or from the environment variables JUPYTER_LOG_LEVEL and JUPYTER_LOGFILE.

Usage

log_debug(...)

log_info(...)

log_error(...)

Arguments

...

message to log


Initialise and run the kernel

Description

Initialise and run the kernel

Usage

main(connection_file = "")

Arguments

connection_file

The path to the Jupyter connection file, written by the frontend