pub struct Quartiles { /* private fields */ }
Expand description

The quartiles

Implementations

Create a new quartiles struct with the values calculated from the argument.

  • s: The array of the original values
  • returns The newly created quartiles
use plotters::prelude::*;

let quartiles = Quartiles::new(&[7, 15, 36, 39, 40, 41]);
assert_eq!(quartiles.median(), 37.5);

Get the quartiles values.

  • returns The array [lower fence, lower quartile, median, upper quartile, upper fence]
use plotters::prelude::*;

let quartiles = Quartiles::new(&[7, 15, 36, 39, 40, 41]);
let values = quartiles.values();
assert_eq!(values, [-9.0, 20.25, 37.5, 39.75, 69.0]);

Get the quartiles median.

  • returns The median
use plotters::prelude::*;

let quartiles = Quartiles::new(&[7, 15, 36, 39, 40, 41]);
assert_eq!(quartiles.median(), 37.5);

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.