npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

datasets-cavendish-density-of-earth

v1.0.0

Published

Dataset from Cavendish's experiments which measured the density of the earth relative to the density of water.

Downloads

2

Readme

Density of Earth

NPM version Build Status Coverage Status Dependencies

Dataset from Cavendish's experiments which measured the density of the earth relative to the density of water.

In 1798, Henry Cavendish conducted experiments to indirectly calculate the gravitational constant in Newton's law of universal gravitation between two bodies having mass m_1 and m_2. Letting M = m_1 and m = m_2,

where M is the earth's mass, G is the gravitational constant, and r is the distance between the two center of masses. If the earth is modeled as a sphere having radius R, Newton's law may be expressed

where g is the acceleration due to gravity and D is the earth's density. Accordingly, the density is inversely proportional to the gravitational constant G.

Installation

$ npm install datasets-cavendish-density-of-earth

For use in the browser, use browserify.

Usage

var data = require( 'datasets-cavendish-density-of-earth' );

data

Raw dataset from Cavendish's experiments which measured the density of the earth relative to the density of water.

console.log( data );
// returns [ 5.5, 5.61, 4.88, ... ]

data.analyzed

When performing his analysis, Cavendish treated the third value 4.88 as 5.88. This dataset acknowledges Cavendish's treatment and replaces the third value.

console.log( data.analyzed );
// returns [ 5.5, 5.61, 5.88, ... ]

data.edited

While conducting his measurements, Cavendish changed his experimental apparatus after the sixth measurement. To remove confounding factors, an edited dataset is included which sets the first 6 values as missing values encoded as null.

console.log( data.edited );
// returns [ null, null, ..., 5.36, ... ]

Notes

  • All measurement values are unit-less, as they are relative measures.

Examples

var mean = require( 'compute-mean' ),
	data = require( 'datasets-cavendish-density-of-earth' );

// Remove the missing values from the edited dataset...
for ( var i = 0; i < 6; i++ ) {
	data.edited.shift();
}

// Calculate the sample means of each dataset...
console.log( mean( data ) );
// returns ~5.448 => true value is 5.517

console.log( mean( data.analyzed ) );
// returns ~5.482 => true value is 5.517

console.log( mean( data.edited ) );
// returns ~5.483 => true value is 5.517

To run the example code from the top-level application directory,

$ node ./examples/index.js

References

  • Cavendish, Henry. (1798). "Experiments to determine the density of the earth." Philosophical Transactions of the Royal Society of London, 88 (Part II), 469-527. Reprinted in A. S. Mackenzie (ed.), The Laws of Gravitation, 1900, New York: American.
  • Stigler, Stephen M. (1977), "Do robust estimators work with real data?", Annals of Statistics, 5, 1055-1098.

Tests

Unit

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.

Test Coverage

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

License

MIT license.

Copyright

Copyright © 2015. The Compute.io Authors.