Skip to contents

The 'webR' (https://docs.r-wasm.org/webr/) project runs R in a web browser through 'WebAssembly'. This package turns a folder of R scripts, data files and package names into a static web site that opens an in-browser workspace (editor, console, files, plots and environment) with those packages and files already in place, and previews it locally. Sites deploy to 'GitHub Pages', 'Netlify' or any static host and can be built to run fully offline; collection_mirror() builds a self-contained 'webR' site and package repository for networks without internet access. Local and 'GitHub' packages are compiled to 'WebAssembly' with 'Docker'.

Package options

Build downloads are cached, so a rebuild reuses them. These settings control the cache, the webR version and the CRAN comparison:

  • Where the cache is. tools::R_user_dir("webrarian", "cache"). Set the R_USER_CACHE_DIR environment variable to move it (webrarian's cache is then its R/webrarian subdirectory). webr_cache_info() shows what is there and webr_cache_clear() removes it. After each webR engine download, only the three most recently used engines are kept, and cached packages are removed for R versions that neither those engines nor this webrarian's own engines use.

  • webrarian.package_cache option, WEBRARIAN_PACKAGE_CACHE environment variable. This is a switch, not a path. Set either to FALSE (or "0") to make every build download its packages afresh. The option wins when both are set. A cached package is reused only when its checksum matches the repository's.

  • WEBRARIAN_WEBR_VERSION environment variable. The webR version used when _webrarian.yml names none, for new collections, and for collection_mirror(). It must be a version tested with this webrarian, or a patch release on the same line (accepted with a warning).

  • webrarian.cran_repo option. The repository check_inventory() and bind() compare WebAssembly package versions with, given as a URL, or FALSE to skip the comparison. Unset, it is the CRAN mirror in getOption("repos"), else https://cloud.r-project.org. Its index is read at most once a day and kept in the user cache, and so is a failed read. When it cannot be reached the CRAN versions are NA, and nothing is printed or fails.

Author

Maintainer: James Balamuta james.balamuta@gmail.com (ORCID) [copyright holder]

Authors:

Other contributors:

  • webR authors (webR JavaScript client bundled in inst/viewer; MIT) [copyright holder]

  • Meta Platforms, Inc. (React, ReactDOM, scheduler and prop-types bundled in inst/viewer; MIT, (c) Facebook, Inc. and its affiliates) [copyright holder]

  • Marijn Haverbeke (CodeMirror, Lezer, style-mod, w3c-keyname and find-cluster-break bundled in inst/viewer; MIT) [copyright holder]

  • Sebastian McKenzie (Babel runtime helpers bundled in inst/viewer; MIT) [copyright holder]

  • uiw (CodeMirror GitHub theme and theme helpers bundled in inst/viewer; MIT) [copyright holder]

  • The xterm.js authors (xterm.js and addon-fit bundled in inst/viewer; MIT) [copyright holder]

  • SourceLair Private Company (xterm.js bundled in inst/viewer; MIT) [copyright holder]

  • Christopher Jeffrey (term.js code in xterm.js bundled in inst/viewer; MIT) [copyright holder]

  • Fabrice Bellard (jslinux vt100 code in xterm.js's stylesheet bundled in inst/viewer; MIT) [copyright holder]

  • Stuart Knightley (JSZip bundled in inst/viewer; MIT election) [copyright holder]

  • David Duponchel (JSZip bundled in inst/viewer; MIT election) [copyright holder]

  • Franz Buchinger (JSZip bundled in inst/viewer; MIT election) [copyright holder]

  • António Afonso (JSZip bundled in inst/viewer; MIT election) [copyright holder]

  • Calvin Metcalf (lie, inside JSZip, bundled in inst/viewer; MIT) [copyright holder]

  • Jordan Harband (lie, inside JSZip, bundled in inst/viewer; MIT) [copyright holder]

  • Barnesandnoble.com llc (immediate and setimmediate, inside JSZip, bundled in inst/viewer; MIT) [copyright holder]

  • Donavon West (immediate and setimmediate, inside JSZip, bundled in inst/viewer; MIT) [copyright holder]

  • Domenic Denicola (immediate and setimmediate, inside JSZip, bundled in inst/viewer; MIT) [copyright holder]

  • Brian Cavalier (immediate, inside JSZip, bundled in inst/viewer; MIT) [copyright holder]

  • Vitaly Puzrin (pako (2.x, and 1.x inside JSZip) bundled in inst/viewer; MIT) [copyright holder]

  • Andrei Tuputcyn (pako (2.x, and 1.x inside JSZip) bundled in inst/viewer; MIT) [copyright holder]

  • Jean-loup Gailly (zlib code ported by pako and bundled in inst/viewer; Zlib license) [copyright holder]

  • Mark Adler (zlib code ported by pako and bundled in inst/viewer; Zlib license) [copyright holder]

  • Adazzle (react-data-grid bundled in inst/viewer; MIT) [copyright holder]

  • Prometheus Research (original react-data-grid work bundled in inst/viewer; MIT) [copyright holder]

  • Pablo Morán (react-accessible-treeview bundled in inst/viewer; MIT) [copyright holder]

  • Cure53 (DOMPurify bundled in inst/viewer; Apache-2.0 election) [copyright holder]

  • Brian Vaughn (react-resizable-panels bundled in inst/viewer; MIT) [copyright holder]

  • The MessagePack Community (msgpack-javascript bundled in inst/viewer; ISC) [copyright holder]

  • Erik Bremen (xterm-readline bundled in inst/viewer; MIT) [copyright holder]

  • Travis Harrison (lezer-r and codemirror-lang-r bundled in inst/viewer; MIT) [copyright holder]

  • Mathias Bynens (emoji-regex bundled in inst/viewer; MIT) [copyright holder]

  • Fonticons, Inc. (Font Awesome 5 icon path data bundled in inst/viewer via react-icons; CC BY 4.0) [copyright holder]

  • kamijin_fanta (react-icons bundled in inst/viewer; MIT) [copyright holder]

  • Sindre Sorhus (string-width, strip-ansi, ansi-regex and is-fullwidth-code-point bundled in inst/viewer; MIT) [copyright holder]

  • Jed Watson (classnames bundled in inst/viewer; MIT) [copyright holder]

  • Luke Edwards (clsx bundled in inst/viewer; MIT) [copyright holder]