return constructMatrix(numRows, cells, fields);
}
protected static SEXP constructMatrix(int numRows, Map<Cell, String> cells,
List<String> fields) {
StringMatrixBuilder matrix = new StringMatrixBuilder(numRows, fields.size());
for(int row=0;row!=numRows;++row) {
for(int col=0; col!=fields.size();++col) {
String value = cells.get(new Cell(row, fields.get(col)));
matrix.setValue(row, col, value);
}
}
matrix.setColNames(fields);
return matrix.build();
}