Description Usage Arguments Examples
Computes the cartesian product of one or more sets.
By default, a matrix is returned, if possible.
Each row, represents one combination.
In some cases, as.list (to return lists) needs to be set to true.
(If there's a lack of supporting methods).
1 |
sets |
List containing one or more vectors. |
gby.last |
Logical, if false (default), group by the first set, then the second, and so on. |
as.list |
Logical, if true, return a list, rather than a matrix. |
... |
Argument list containing one or more standard vectors. |
1 2 | cprod (1:2, 1:4)
cprod (1:2, 1:4, gby.last=TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.