outer | R Documentation |
The outer product of two vectors of permutations is the pairwise product of each element of the first with each element of the second.
It works in much the same way as base::outer()
. The third
argument, FUN
, as in outer(X,Y,FUN="*")
is regular
group-theoretic multiplication but can be replaced with +
if you
are sure that the cycles of X
and Y
are distinct, see the
examples. Each element of the returned matrix is a one-element list.
The print method may have room for improvement.
Robin K. S. Hankin
(M <- outer(rperm(),rperm()))
outer(cyc_len(4) + 0:3, cyc_len(4) + 100:101,"+") # OK because the cycles are distinct
do.call("c",M) # c(M) gives a list and unlist(a) gives a numeric vector
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.