| outer {sets} | R Documentation |
Outer “product” of (g)sets (tuples).
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)
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 |
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.
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, "^")