freq

From The K Language Wiki
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