Title: | Companion to the 'xeus-r' 'jupyter' Kernel |
Version: | 0.1.1 |
Description: | Set of R functions to be coupled with the 'xeus-r' 'jupyter' kernel in order to drive execution of code in notebook input cells, how R objects are to be displayed in output cells, and handle two way communication with the front end through comms. |
License: | MIT + file LICENSE |
Encoding: | UTF-8 |
RoxygenNote: | 7.3.2 |
Imports: | cli, evaluate, glue, IRdisplay, jsonlite, R6, repr, rlang, tools, utils |
URL: | https://github.com/jupyter-xeus/xeus-r |
BugReports: | https://github.com/jupyter-xeus/xeus-r/issues |
NeedsCompilation: | no |
Packaged: | 2025-04-09 12:54:37 UTC; romainfrancois |
Author: | Romain François [aut, cre], QuantStack [cph] |
Maintainer: | Romain François <romain@tada.science> |
Repository: | CRAN |
Date/Publication: | 2025-04-10 09:10:05 UTC |
Comm class
Description
Comm class
Comm class
Active bindings
id
id of the comm. read only.
target_name
name of the target for this comm
Methods
Public methods
Method new()
Usage
Comm$new(xp, description = "")
Arguments
xp
external pointer to an instance of the C++ class 'xeus::xcomm'
description
description of this comm
Method open()
Usage
Comm$open(data = NULL, metadata = NULL)
Arguments
data
data
metadata
metadata
Method close()
Usage
Comm$close(data = NULL, metadata = NULL)
Arguments
data
data
metadata
metadata
Method send()
Usage
Comm$send(data = NULL, metadata = NULL)
Arguments
data
data
metadata
metadata
Method on_close()
Usage
Comm$on_close(handler)
Arguments
handler
function to call when the comm is closed
Method on_message()
Usage
Comm$on_message(handler)
Arguments
handler
function to call when receiving a message
Method print()
Usage
Comm$print()
Returns
information about the comm
Method clone()
The objects of this class are cloneable with this method.
Usage
Comm$clone(deep = FALSE)
Arguments
deep
Whether to make a deep clone.
Comm Manager class
Description
Instance of the CommManagerClass class.
Usage
CommManager
Format
An object of class CommManagerClass
(inherits from R6
) of length 11.
Methods
Public methods
Method new()
Usage
CommManagerClass$new(..., error_call = caller_env())
Arguments
...
currently unused
error_call
Method register_comm_target()
Usage
CommManagerClass$register_comm_target( target_name, callback = function(comm, message) { } )
Arguments
target_name
name of the comm target, e.g. "jupyter.widgets"
callback
callback function taking two arguments 'comm' and 'message'.
Method unregister_comm_target()
Usage
CommManagerClass$unregister_comm_target(target_name)
Arguments
target_name
name of the comm target
Method new_comm()
Usage
CommManagerClass$new_comm(target_name, description = "")
Arguments
target_name
name of the target
description
description of the comm
Method comms()
Usage
CommManagerClass$comms()
Returns
the list of currently open comms
Method target_callback()
Usage
CommManagerClass$target_callback(target_name)
Arguments
target_name
name of the comm target
Returns
the callback for that target name
Method preserve()
Usage
CommManagerClass$preserve(comm)
Arguments
comm
Comm instance to preserve
Method release()
Usage
CommManagerClass$release(comm)
Arguments
comm
Comm instance to release
Method get_comm_info()
Usage
CommManagerClass$get_comm_info(target_name = NULL)
Arguments
target_name
name of the target to get info about all comm opens. If NULL, info for comms for all targets are returned.
Method clone()
The objects of this class are cloneable with this method.
Usage
CommManagerClass$clone(deep = FALSE)
Arguments
deep
Whether to make a deep clone.
View
Description
View
Usage
View(x, title)
Arguments
x |
something to display |
title |
title of the display |
Examples
## Not run:
View(mtcars)
## End(Not run)
Options for current jupyter cell
Description
Options for current jupyter cell
Usage
cell_options(...)
Arguments
... |
options to set locally to the notebook cell. Forwarded to |
Examples
## Not run:
cell_options(repr.plot.bg = "gray")
## End(Not run)
Clear output
Description
Clear output
Usage
clear_output(wait = FALSE)
Arguments
wait |
Should this wait |
Value
NULL invisibly
Examples
## Not run:
clear_output()
## End(Not run)
Code completion
Description
Code completion
Usage
complete(code, cursor_pos = nchar(code))
Arguments
code |
R code to complete |
cursor_pos |
position of the cursor |
Value
a list that contains potential completions as the first item
Examples
complete("rnorm(")
Display data
Description
Display data
Usage
display_data(data = NULL, metadata = NULL)
Arguments
data |
data to display |
metadata |
potential metadata |
Examples
## Not run:
display_data(mtcars)
## End(Not run)
Is this a running xeusr jupyter kernel
Description
Is this a running xeusr jupyter kernel
Usage
is_xeusr()
Value
TRUE if the current session is running in a xeusr kernel
Examples
is_xeusr()
bundle an object
Description
bundle an object
Usage
mime_bundle(x, mimetypes = mime_types(x), ...)
Arguments
x |
an object |
mimetypes |
mime types |
... |
extra currently unused parameters |
See Also
IRdisplay::prepare_mimebundle which this currently wraps around
Examples
mime_bundle(letters)
MIME types supported by an object
Description
MIME types supported by an object
Usage
mime_types(x)
Arguments
x |
an object |
Value
a character vector of its supported mime types
Examples
mime_types(letters)
mime_types(mtcars)
Objects exported from other packages
Description
These objects are imported from other packages. Follow the links below to see their documentation.
- IRdisplay