@tidyjs/tidy
Version:
Tidy up your data with JavaScript, inspired by dplyr and the tidyverse
16 lines (13 loc) • 417 B
JavaScript
import { summarize } from './summarize.js';
import { n } from './summary/n.js';
import { sum } from './summary/sum.js';
function tally(options) {
const _tally = (items) => {
const {name = "n", wt} = options != null ? options : {};
const summarized = summarize({[name]: wt == null ? n() : sum(wt)})(items);
return summarized;
};
return _tally;
}
export { tally };
//# sourceMappingURL=tally.js.map