I really like R. I find it a nice language to work in. I'm glad to see projects like this that make it more accessible.
Here’s a ggplot2 example: https://webr.sh/#code=eJxtkLFOwzAQhsWapzh5ckSUpEgsSBkY2RAVrN...
What does this mean in practice? Does this mean you could start with a blank .html file, and use html, css, and javascript (like normal), but then somehow run R too? e.g. to generate a ggplot using the browser (as opposed to server, as a shiny app may)?
Has anyone got a minimal reproducible examples (e.g. tiny html file that runs, say 2 * 2 in R)? The example linked to in the article has the key line <script type="module" src="repl.mjs"></script>, but that mjs file goes over my head.
Curious/eager/excited to know/see what kinds of real-world applications this has.
Jupyterlite-xeus compiles jupyterlab to WASM.
jupyterlite-xeus builds jupyterlite, Jupyter xeus kernels, and the specified dependencies to WASM with packages from conda-forge or emscripten-forge.
The jupyterlite-xeus docs say that the xeus-r kernel is already supported: https://github.com/jupyterlite/xeus
jupyter-xeus/xeus-r: https://github.com/jupyter-xeus/xeus-r
emscripten-forge/recipes already has packages for "r-askpass, r-base, r-base64enc, r-bit, r-bit64, r-cachem, r-cli, r-colorspace, r-data.table, r-digest, r-dplyr, r-ellipsis, r-fansi, r-farver, r-fastmap, r-ggrepel, r-glue, r-haven, r-hexbin, r-htmltools, r-isoband, r-jsonlite, r-later, r-lattice, r-lazyeval, r-magrittr, r-mass, r-matrix, r-mgcv, r-mime, r-nlme, r-plyr, r-promises, r-purrr, r-rcpp, r-readr, r-rlang, r-sp, r-stringi, r-sys, r-tibble, r-tidyr, r-tzdb, r-utf8, r-vctrs, r-vroom, r-xfun, r-yaml" in WASM: https://github.com/emscripten-forge/recipes/tree/main/recipe...
It looks like xeus-r and webr both compile with emscripten; for which there's emscripten-forge which is like conda-forge but for browser WASM.
Does this also support Rmd?
That would be pretty cool if you could publish an rstudio notebook and have a flow to edit a copy of the notebook straight in the web.
Does it include a decent BLAS? If I remember correctly R ships with reference BLAS, but for decent performance you need something external. Wonder what they picked for wasm based R.
Can you install it as a progressive web app, to work offline as well?
Is there "Julia in the browser" that runs locally?
Cool but 12MB WASM blob. I wish there was a way of making these WASM builds significantly smaller.
eval_js()- allows R code to execute JavaScript and manipulate DOM elements - neat.
Very useful, thanks
If you want to use it to create ggplot2 charts, here is an open source demo: https://github.com/QuesmaOrg/demo-webr-ggplot/
I created it as a side project from using WebR to execute code LLM-generated code (https://quesma.com/blog-detail/sandboxing-ai-generated-code-...). While we migrated away from it, I saw that WebR is cool, and I wanted to share it with you.