{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Creating Boxplots with daru and statsample\n", "\n", "### Description\n", "\n", "This example illustrates how daru, combined with Statsample::Graph::Boxplot\n", "can be used for generating box plots of a normally distributed set of data.\n", "\n", "The 'rnorm' function, defined in statsample/shorthands generates a Daru::Vector\n", "object which contains the specified number of random variables in a normal distribution.\n", "It uses the 'distribution' gem for this purpose." ] }, { "cell_type": "code", "execution_count": 7, "metadata": { "collapsed": false, "scrolled": false }, "outputs": [ { "data": { "text/plain": [ "Daru::Vector" ] }, "execution_count": 7, "metadata": {}, "output_type": "execute_result" } ], "source": [ "require 'daru'\n", "require 'statsample'\n", "include Statsample::Shorthand\n", "\n", "n = 30\n", "a = rnorm(n-1,50,10)\n", "b = rnorm(n, 30,5)\n", "c = rnorm(n,5,1)\n", "a.push(2)\n", "\n", "a.class" ] }, { "cell_type": "code", "execution_count": 8, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/html": [ "
\n", "\n" ], "text/plain": [ "#