ListTools
Occurrences
number of occurrences in a list
Calling Sequence
Parameters
Description
Examples
Occurrences(x, L)
Occurrences(x, L, f, opts)
x
-
anything
L
list
f
(optional) boolean valued procedure
opts
(optional) extra arguments to procedure f
The Occurrences(x, L) command returns the number of entries in the list L which equal x using a boolean comparison.
If a function f is provided, equality is tested using f(x, L[i], opts) for each element in the list.
The number of entries approximately equal to 3.263.
In the following example, the Occurrences command is used in conjunction with the ListTools:-FindRepetitions command to find the mode of a list with alpha-numeric values:
See Also
type/list
verify
Download Help Document