Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/irkernel/irdisplay
Jupyter display machinery for R
https://github.com/irkernel/irdisplay
Last synced: 6 days ago
JSON representation
Jupyter display machinery for R
- Host: GitHub
- URL: https://github.com/irkernel/irdisplay
- Owner: IRkernel
- License: other
- Created: 2014-04-01T01:23:51.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2023-03-06T14:51:24.000Z (almost 2 years ago)
- Last Synced: 2024-11-28T18:49:58.275Z (about 1 month ago)
- Language: R
- Homepage: https://cran.r-project.org/package=IRdisplay
- Size: 85.9 KB
- Stars: 47
- Watchers: 5
- Forks: 16
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
IRdisplay [![b-CI]][CI] [![b-CRAN]][CRAN]
=========[b-CI]: https://github.com/IRkernel/IRdisplay/actions/workflows/r.yml/badge.svg?branch=master "Build status"
[CI]: https://github.com/IRkernel/IRdisplay/actions/workflows/r.yml
[b-CRAN]: https://www.r-pkg.org/badges/version/IRdisplay "Comprehensive R Archive Network"
[CRAN]: https://cran.r-project.org/package=IRdisplayIRdisplay is a front-end package for Jupyter.
It’s automatically integrated into [IRkernel][] when you open a Jupyter notebook using that kernel.The primary, high level functions are:
```r
display(obj, ..., mimetypes=, error_handler=stop)display_png(data = NULL, file = NULL, width = NULL, height = NULL)
# display_jpeg(…); display_pdf(…); display_svg(…)display_html(data = NULL, file = NULL)
# display_javascript(…), display_json(…), display_markdown(…), display_latex(…)
```Use `display` to display an object in all configured mime types (see **Configuration**),
and the `display_*` functions to display raw data you have in form of a file or a variable.Manual use is possible via the `*_mimebundle` functions:
```r
prepare_mimebundle(obj, mimetypes=, metadata=NULL, error_handler=stop)
publish_mimebundle(data, metadata = NULL)
```Where `prepare_mimebundle` uses `repr` to create a mimebundle containing representations of objects,
and `publish_mimebundle` sends such mimebundles to Jupyter.[IRkernel]: https://irkernel.github.io/running/
Configuration
-------------You can add your own mime types that should be displayed via:
```r
options(jupyter.display_mimetypes = union(getOption('jupyter.display_mimetypes'), ...))
```If you want to create your own kernel reacting to `display` / `publish_mimebundle` calls, you can use:
```r
options(jupyter.base_display_func = function(data, metadata = NULL) ...)
```