code: function dfFromMatrixHelper(matrix, startRow, colNames) {
    var nCol = colNames.size();
    var nRow = matrix.length - startRow;
    var columns = allocArray(nCol);
    var j;
    for (j = 0; j < nCol; j++) {
      columns[j] = allocArray(nRow);
    }
    for (var i = 0; i < nRow; i++) {
      var rowArray = matrix[i + startRow];
      if (rowArray.length !== nCol) {
        throw new Error('all row arrays must be of the same size');
      }
      for (j = 0; j < nCol; j++) {
        columns[j][i] = rowArray[j];
      }
    }
    return newDataFrame(columns, colNames);
  }
docs: Forms a data frame using 'matrix' starting with 'startRow' and setting column names to the 'colNames' string vector