Two-dimensional tabular data structure.
$ npm install compute-data-frameFor use in the browser, use browserify.
To use the module,
varDataFrame=require('compute-data-frame');Data frame constructor. To create a new DataFrame, provide an array of arrays.
vardata=[[1,2,3],[4,5,6]];vardf=newDataFrame(data);The constructor also accepts the following options:
rownames: row namearray. If not provided, each row name defaults to the row index.colnames: column namearray. If not provided, each column name defaults to the column index.
To specify options at instantiation, provide an options object.
vardata=[[1,2,3],[4,5,6]];varrownames=['beep','boop'],colnames=['a','b','c'];vardf=newDataFrame(data,{'rownames': rownames,'colnames': colnames});varDataFrame=require('compute-data-frame');To run the example code from the top-level application directory,
$ node ./examples/index.jsUnit tests use the Mocha test framework with Chai assertions. To run the tests, execute the following command in the top-level application directory:
$ make testAll new feature development should have corresponding unit tests to validate correct functionality.
This repository uses Istanbul as its code coverage tool. To generate a test coverage report, execute the following command in the top-level application directory:
$ make test-covIstanbul creates a ./reports/coverage directory. To access an HTML version of the report,
$ make view-covCopyright © 2015. Athan Reines.