WebR – R in the Browser
9 comments
·August 19, 2025nomilk
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.
null
Qem
Can you install it as a progressive web app, to work offline as well?
stabbles
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.
shakna
Probably uses LLVM Flang to make the Fortran parts happen, compiling reference BLAS and LAPACK. As the main dev for WebR is also the one who did this [0].
uniqueuid
I wonder what kind of edge cases you deal with when blas is your bottleneck in R. Stan code aside, I’ve seen few problems that are neither instant (i.e. sub hours) nor impossible (I.e years of compute).
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.