Skip to content

ndabAP/lorenz-curve

Repository files navigation

NOT MAINTAINED lorenz-curve

Installation

npm install lorenz-curve --save

API

lorenzCurve(data: Number[], precision: Number)

Parameter Type Description
data Number[] Data set
precision Number Precision for ratios (default: 2)

Usage

import lorenzCurve from 'lorenz-curve'
import * as assert from 'assert'

const {x, y} = lorenzCurve([3, 4, 5, 5, 18])

assert.deepEqual(x, [0.2, 0.4, 0.6, 0.8, 1])
assert.deepEqual(y, [0.09, 0.2, 0.34, 0.49, 1])

If you are using require, you have to attach .default.

Author

Julian Claus and contributors.

License

MIT

About

NOT MAINTAINED Get the lorenz curve of a given data set

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published