How to quickly find the version of R that webR runs? #567
Replies: 1 comment 1 reply
-
The majority of that time will just be awaiting for webR to I think we should add this to the In the meantime, if you're brave enough to be really cheeky you could read out the version directly from the installed R WebAssembly binary:
This works because the R Wasm binary contains a minimal filesystem for launching R, including the file |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
One can quickly (~65 ms) identify the webR version using:
$ node --input-type=module -e 'const t0 = performance.now(); import { WebR } from "webr"; const webr = new WebR(); console.log(webr.version); console.log(performance.now() - t0); process.exit(0);' 0.5.5 65.4388900026679
Is there a way to quickly identify the version of R that the current webR provides?
The only way I know is to launch webR and call
getRversion()
, but that is slow (~2.5 seconds), e.g.$ node --input-type=module -e 'const t0 = performance.now(); import { WebR } from "webr"; const webr = new WebR(); await webr.init(); await webr.evalR("cat(as.character(getRversion()))"); console.log(performance.now() - t0); process.exit(0);' 4.5.1 2427.1900480017066
PS. My goal is to identify the "x.y" version of R in webR, such that I can install rwasm packages to a specific R package library on host, e.g.
~/.R/emscripten/4.4
and~/.R/emscripten/4.5
.Beta Was this translation helpful? Give feedback.
All reactions