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

    Function matrix

    • Build a matrix from data, recycled to fill it. Equivalent to R's matrix(). Filled by columns unless byrow.

      Parameters

      Returns number[][]

      matrix([1, 2, 3, 4, 5, 6], { nrow: 2 }); // [[1, 3, 5], [2, 4, 6]]
      matrix(0, { nrow: 2, ncol: 3 }); // [[0, 0, 0], [0, 0, 0]]