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

    Function add

    • Element-wise sum with R's recycling (a shorter vector is recycled down the columns of a matrix). Equivalent to R's +.

      Parameters

      Returns number[] | number[][]

      add([[1, 2], [3, 4]], [10, 20]); // [[11, 12], [23, 24]]
      add([1, 2, 3], 2); // [3, 4, 5]