Socket
Book a DemoInstallSign in
Socket

rstat

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rstat

0.1.2
bundlerRubygems
Version published
Maintainers
1
Created
Source

Rstat

Gem Version Travis

A very simple statistics gem.

Installation

$ gem install rstat

Usage

require 'rstat'
 => true
[1, 2, 3, 4, 5].mean
 => 3.0

Currently Adds

Arithmetic

  • Sum
  • Product
  • Binomial Coefficient

Descriptive Statistics

Location

  • Arithmetic Mean
  • Geometric Mean
  • Harmonic Mean
  • Power Mean
  • Median
  • Mode

Dispersion

  • Range
  • Standard Deviation
  • Coefficient of Variation
  • Percentile
  • Interquartile Range

Shape

  • Variance
  • Skewness
  • Kurtosis
  • Central Moments
  • Raw Moments

Count Data

  • Index of Dispersion

Regression Analysis

Linear Regression

  • Simple Linear Regression

Running Tests

Rstat depends upon RSpec for its tests.

To run all the tests for the gem:

$ rspec spec

To run one particular spec file:

$ rspec spec/rstat/array_spec.rb

To run one particular line of a spec file:

$ rspec spec/rstat/array_spec.rb:177

Rstat has been tested with Ruby 1.8.7, 1.9.3, and 2.0.0. There's little reason it shouldn't work with other versions of Ruby though.

Console

Rstat includes a rake task to open up an irb session with the gem source preloaded. This is particularly useful if you're working with a local development copy of the gem's source and want to experiment with your changes. To use the preloaded console:

$ rake console

Contributing

If you feel like you can add something useful to Rstat then don't hesitate to send a pull request.

A Note of Warning

This gem extends the core Array class and Fixnum class. In isolation this is usually pretty harmless. But, in combination with other gems that do the same, unpredictable behavior may result. As always, use caution, and be aware of what this gem and any others you use actually do before including it in an important project.

FAQs

Package last updated on 22 Aug 2013

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.