outer {sets} | R Documentation |
Outer Product of Sets (Tuples)
Description
Outer “product” of (g)sets (tuples).
Usage
set_outer(X, Y, FUN = "*", ..., SIMPLIFY = TRUE, quote = FALSE)
gset_outer(X, Y, FUN = "*", ..., SIMPLIFY = TRUE, quote = FALSE)
cset_outer(X, Y, FUN = "*", ..., SIMPLIFY = TRUE, quote = FALSE)
tuple_outer(X, Y, FUN = "*", ..., SIMPLIFY = TRUE, quote = FALSE)
Arguments
X , Y |
Set (tuple) objects or vectors. If |
FUN |
A function or function name (character string). |
SIMPLIFY |
Logical. If |
quote |
logical indicating whether the character strings used for the row and column names of the returned matrix should be quoted. |
... |
Additional arguments passed to the |
Details
This function applies FUN
to all pairs of elements specified in
X
and Y
. Basically intended as a replacement for
outer
for sets (tuples), it will also accept any vector for
X
and Y
. The return value will be a matrix of dimension
length(X)
times length(Y)
, atomic or recursive
depending on the complexity of FUN
's return type and the
SIMPLIFY
argument.
See Also
Examples
set_outer(set(1,2), set(1,2,3), "/")
X <- set_outer(set(1,2), set(1,2,3), pair)
X[[1,1]]
Y <- set_outer(set(1,2), set(1,2,3), set)
Y[[1,1]]
set_outer(2 ^ set(1,2,3), set_is_subset)
tuple_outer(pair(1,2), triple(1,2,3))
tuple_outer(1:5, 1:4, "^")