Build a matrix from data, recycled to fill it. Equivalent to R's matrix(). Filled by columns unless byrow.
matrix()
byrow
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]] Copy
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]]
Build a matrix from data, recycled to fill it. Equivalent to R's
matrix(). Filled by columns unlessbyrow.