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.
Click to show internal directories.
Click to hide internal directories.