histogram! ( hashtable seq -- hashtable )
Statistics ยป Computing histograms

Prev:histogram-by ( seq quot: ( x -- bin ) -- hashtable )
Next:sorted-histogram ( seq -- alist )


Vocabulary
math.statistics

Inputs
hashtablea hashtable
seqa sequence


Outputs
hashtablea hashtable


Word description
Takes an existing hashtable and uses histogram to continue counting the number of occurrences of each element.

Examples

! Count the number of times the elements of two sequences appear. USING: prettyprint math.statistics ; "aaabc" histogram "aaaaaabc" histogram! .
H{ { 97 9 } { 98 2 } { 99 2 } }



Definition

: histogram! ( hashtable seq -- hashtable )
[ ] histogram-by! ; inline