libRmath.js
libRmath.js copied to clipboard
require in Observable
require("lib-r-math.js") dosen't work within Observable
Hi @neocarto
I am not familiar with ObservableHQ, but I found this link
https://observablehq.com/@observablehq/module-require-debugger
After entering lib-r-math.js
in the input field it showed me this screenshot (below) on how to use it
I guess "Observable"s run in a browser in that case you can access all functions from window.libR
prefix or libR
prefix
Note: I am not sure how Observable execute javascript (sandboxed?),
In any case the new version of lib-r-math.js
(2.0) will use the standardized JS module system.
Unfortunately, the require does not work in observable for the moment. Anyway, I can't wait to try lib-r-math.js (2.0). Do you know when this version will be available?
@neocarto, sorry for getting back at you so late, it will be available on 01.nov.2022
2023 ?
Corrected))
Hi @neocarto , I got it working on observablehq.com (see screenshot below made from the website using the lib)
It is version 2.0.0 release candidate rc1, there are a number of breaking changes, but you can browse the exported functions in observable and infer their usage,
I still have to re-write the document (README.md) , some distributions have a wasm backend (useHyperGeomBackend
and useSignRankBackend
)
Let me know if this is working for you
Cheers,
@neocarto,
Version 2.0.0 officially released, note the "breaking changes" and wasm backends https://www.npmjs.com/package/lib-r-math.js?activeTab=readme