Description
libRmath.js is a TypeScript and JavaScript port of R's nmath library, the set of statistical functions behind R. It includes probability distributions such as normal, gamma, beta, Poisson, Student-t, Weibull and Wilcoxon, special functions such as Bessel, beta, gamma and choose, and several pseudo-random generators, including Mersenne Twister. Some functions, such as the hypergeometric distribution, are written in handwritten WebAssembly. The library has no external dependencies. It is meant for developers who need R-compatible statistics in a JavaScript or TypeScript project without calling out to R. The documentation assumes you know R's built-in functions. Version 2.0 removed some helper functions and changed how the random number generators are selected, so people moving from version 1 should read the breaking changes section. The source is on GitHub, and older versions have their own maintained branches.…
Highlights
- Probability distributions from beta to Weibull
- Special functions: Bessel, beta, gamma and choose
- Several pseudo-random number generators
- No external dependencies
- Some functions in WebAssembly
Ratings & Reviews
No ratings yet
Be the first to rate LibRmath.js.
People also visit
LibRmath.js FAQ
What is libRmath.js?
A port of R's nmath statistics library to TypeScript and JavaScript, with some functions written in WebAssembly.
Does it need R installed?
No. The library has zero external dependencies and does not call R. The documentation does assume you know R's built-in functions.
Which distributions are included?
Beta, binomial, negative binomial, Cauchy, chi-squared, exponential, Fisher F, gamma, geometric, hypergeometric, logistic, log normal, multinomial, normal, Poisson, Student-t, Tukey, uniform, Weibull and Wilcoxon.
What changed in version 2.0?
Helper functions such as any, flatten and map were removed, and the normal and uniform random number generators are now selected only through RNGkind. The UMD module was also removed.
Is it open source?
Yes. The code is on GitHub at jacobbogers/libRmath.js.
What are the best LibRmath.js alternatives?
Popular alternatives to LibRmath.js include Simple Statistics, Data Science Toolkit and Nerdamer. See all LibRmath.js alternatives








