hist

command
v0.0.0-...-49b2a1a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 25, 2016 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

hist computes a histogram on its input.

# Show a histogram of words in input (uses naive tokenization)
$ hist -words < corpus.txt
   203 of        +
   771 a         ++++
  4025 the       +++++++++++++++++++++++
       ...

# Same, on input that happens to have a word per line. Use log scale in graph.
$ hist -scale=log < corpus_tokenized.txt
   203 of        +++++++++++++++
   771 a         ++++++++++++++++++
  4025 the       +++++++++++++++++++++++
       ...

# Show a histogram of the 2nd field, using the 3rd field as weight.
$ cat mydata
orange vest 42
blue vest 5
white jumpsuit 2

$ hist -k 2 -w 3 -graph=false < mydata
     2 jumpsuit
    47 vest
       ...

# You can set -ofs=, for CSV output, or \t for TSV.
$ hist -k -w 3 -graph -ofs=\\t

Output order is by increasing counts. To change order, pipe through sort and possibly use its -n and -k flags.

Currently only integer data is supported.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL