StatisticalMethods
Statistical methods - easy and simple.
Installation
Add this line to your application's Gemfile:
gem 'statistical_methods'
And then execute:
$ bundle
Or install it yourself as:
$ gem install statistical_methods
Usage
StatisticalMethods::Computer.sum(array)
StatisticalMethods::Computer.mean(array)
StatisticalMethods::Computer.range(array)
StatisticalMethods::Computer.standard_deviation(array)
StatisticalMethods::Computer.median(array)
You can include methods into Array class:
Array.send(:include, StatisticalMethods::Array)
and use
[1,2,3].sum #=> 6.0
[1,2,3].mean #=> 2.0
[1,2,3].range #=> 1.0, 3.0
[1,2,3].median #=> 2.0
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request