Data on the historical frequency of male first names in the population of U.S. births.
$ npm install datasets-male-first-names-us-frequency
var data = require( 'datasets-male-first-names-us-frequency' );
A data object
with keys corresponding to all the names given to male children born in the United States in the period from 1880-2014
. All names are in lower-case letters. For each name, an array-of-arrays
is exported with birth frequencies for each year. For years in which less than five children with a certain name were born, no data is available.
// Retrieve data for the name "Kaden"
data.kaden
/*
[
[1977,5],
[1980,5],
[1982,6],
(...),
[2012,2939],
[2013,2617],
[2014,2440]
]
*/
The original data was collected by the Social Security Administration and is based on Social Security card applications for births that occurred in the United States after 1879. Since this data is based on government documents, it should be considered public domain.
// Frequencies for name `Herbert`
var freq,
i;
freq = require('datasets-male-first-names-us-frequency/lib/herbert.json' );
for( i = 0; i < freq.length; i++ ) {
console.log( 'Year: ' + freq[ i ][ 0 ] + '; Count: ' + freq[ i ][ 1 ] );
}
To run the example code from the top-level application directory,
$ node ./examples/index.js
Unit tests use the Mocha test framework with Chai assertions. To run the tests, execute the following command in the top-level application directory:
$ make test
All 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-cov
Istanbul creates a ./reports/coverage
directory. To access an HTML version of the report,
$ make view-cov
Copyright © 2015. The Compute.io Authors.