Skip to main content
Module

x/simplestatistics/index.js>equalIntervalBreaks

simple statistics for node & browser javascript
Go to Latest
function equalIntervalBreaks
import { equalIntervalBreaks } from "https://deno.land/x/simplestatistics@v7.7.5/index.js";

Given an array of x, this will find the extent of the x and return an array of breaks that can be used to categorize the x into a number of classes. The returned array will always be 1 longer than the number of classes because it includes the minimum value.

Examples

equalIntervalBreaks([1, 2, 3, 4, 5, 6], 4); // => [1, 2.25, 3.5, 4.75, 6]

Parameters

x

an array of number values

nClasses

number of desired classes