freq

From The K Language Wiki
Revision as of 06:41, 9 July 2022 by Promovicz (talk | contribs) ("Better category ordering, add redirects to categories, fix pseudo-adverb categories")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Freq
freq x
Supported in K7

freq creates a frequency table for the elements of a given array.

 freq 3 4 5
3|1
4|1
5|1

 freq 3 3 4 5
3|2
4|1
5|1

 freq(3 4 5;3 4 5;1;"ab";"bc";"ab")
"ab" |2
"bc" |1
3 4 5|2
1    |1