ListTools[Group] - group a list into an expression sequence of lists
|
Calling Sequence
|
|
Group(f, L, opts, ...)
Group[N](f, opt[1], ..., opt[N-1], L, opts, ...)
|
|
Parameters
|
|
L
|
-
|
list
|
f
|
-
|
procedure
|
N
|
-
|
positive integer
|
opts
|
-
|
(optional) options to procedure f
|
|
|
|
|
Description
|
|
•
|
The Group(f, L) function groups list L into sublists where procedure f returns either true or false. The value of procedure f is determined by the expression evaluated for each element x of list L.
|
|
The Group(f, L, opts) function performs in a similar manner, except that the value of procedure f is determined by the expression .
|
•
|
If Group is indexed by a positive integer N, the expression is evaluated for each list element x.
|
|
|
Examples
|
|
>
|
|
>
|
|
| (1) |
>
|
|
| (2) |
>
|
|
| (3) |
>
|
|
| (4) |
>
|
|
| (5) |
>
|
|
| (6) |
>
|
|
| (7) |
|
|
Download Help Document
Was this information helpful?