lodash-math
v0.0.7
Published
lodash extension providing math / stats operations on collections.
Downloads
51
Maintainers
Readme
lodash.math
Lo-dash extension providing math / stats operations on collections.
It's based on underscore.math which itself is based on Mootools Array.Math
Available methods:
- average (mean)
- gcd
- lcm
- median
- mode
- movingAverage
- power
- product
- round
- scale
- slope
- sort
- stdDeviation (sigma)
- sum
- transpose
- variance
- weightedAverage
- zscore
F.A.Q
What is the difference with the underscore version?
This library uses the implicit chaining capabilities of Lodash.
Released under MIT license
NodeJS usage:
var _ = require('lodash');
require('lodash-math')(_);
_.range(15).mean();
or
A lodash will be prodived if none is given. It will not corrupt the main module.
var _math = require('lodash-math')();
or
Other _ providers can be used.
var _ = require('underscore');
require('lodash-math')(_);
_.mode([1,2,2.2,3,4,3],Math.round); //Yields [2,3]