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

    Function mean

    • Arithmetic mean, optionally trimmed. Equivalent to R's mean(). Accurate to the last bit: the sum is taken in double-double and corrected by the mean deviation, as R corrects its long double mean.

      Parameters

      Returns number

      mean([1, 2, 3, 10]);                // 4
      mean([1, 2, 3, 10], { trim: 0.25 }); // 2.5