stats 1.0.0

  • Readme
  • Changelog
  • Example
  • Installing
  • 89

Build Status Pub

import 'package:stats/stats.dart';

void main() {
  final input = [1, 2, 3, 4, 5, 6, 7, 8];
  print('Input: $input');
  final stats = Stats.fromData(input);
  // {count: 8, mean: 4.5, median: 4.5, max: 8, min: 1, standardDeviation: 2.29, rms: 5.05}
  print(stats.withPrecision(3));
}

1.0.0 #

  • Added LightStats class and corresponding extension.
    • Unlike Stats, creating LightStats does not create and sort a List with the entire source contents. It is "cheaper" to use, especially with large inputs.
  • Stats
    • Now has a type argument <T extends num>.
    • implements LightStats.
    • Added fromSortedList factory.
    • standardError is now an on-demand calculated property instead of a field.
    • Renamed mean to average.
  • Added Iterable<num> extensions: lightStats, stats, min, max, sum and average.
  • Require Dart SDK >=2.7.0 <3.0.0.

0.2.0+3 #

  • Support latest package:json_annotation.

0.2.0+2 #

  • Support latest package:json_annotation.

0.2.0+1 #

  • Fix readme.

0.2.0 #

  • Initial release.

example/example.dart

import 'package:stats/stats.dart';

void main() {
  final input = [1, 2, 3, 4, 5, 6, 7, 8];
  print('Input: $input');
  final stats = Stats.fromData(input);
  // {count: 8, mean: 4.5, median: 4.5, max: 8, min: 1, standardDeviation: 2.29, rms: 5.05}
  print(stats.withPrecision(3));
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  stats: ^1.0.0

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter pub get

Alternatively, your editor might support pub get or flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:stats/stats.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
78
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
89
Learn more about scoring.

We analyzed this package on Mar 26, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.1
  • pana: 0.13.6

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.7.0 <3.0.0
json_annotation ^3.0.0 3.0.1
Dev dependencies
build_runner ^1.0.0
build_verify ^1.1.0
json_serializable ^3.0.0
pedantic ^1.2.0
test ^1.3.0