Generates a frequency table.
The output is an array of arrays. Each sub-array corresponds to a unique value in the input collection and is structured as follows:
If provided an empty collection, the function returns an empty array.
input collection
frequency table
var arr = [ 'beep', 'boop', 'foo', 'beep' ]; var out = tabulate( arr ); // returns [ [ 'beep', 2, 0.5 ], [ 'boop', 1, 0.25 ], [ 'foo', 1, 0.25 ] ]
Generates a frequency table.
Notes
The output is an array of arrays. Each sub-array corresponds to a unique value in the input collection and is structured as follows:
If provided an empty collection, the function returns an empty array.