rStats.js v1.3.0
    Preparing search index...

    Function table

    • Frequency table of the distinct values. Equivalent to R's table(). For one numeric vector: values in increasing order (NaN last when counted) with their counts. As in R, values with the same text (15 significant digits, as R's as.character) are counted as one, under the smallest of them.

      Parameters

      Returns { counts: number[]; values: number[] }

      • counts: number[]

        How often each value occurs.

      • values: number[]

        The distinct values, in increasing order (NaN last when missing values are counted); R's names.

      table([3, 1, 3, 2, 3]); // { values: [1, 2, 3], counts: [1, 1, 3] }