The outer product of the arrays X and Y is the array A with dimension c(dim(X), dim(Y)) where element A[c(arrayindex.x, arrayindex.y)] = FUN(X[arrayindex.x], Y[arrayindex.y], …).
outer(X, Y, FUN = "*", …)
X %o% Y
| Parameter | Description |
|---|---|
X, Y |
First and second arguments for function FUN. Typically a vector or array. |
FUN |
a function to use on the outer products, found via match.fun (except for the special case "*"). |
… |
optional arguments to be passed to FUN. |
# NOT RUN {
x <- 1:9; names(x) <- x
# Multiplication & Power Tables
x %o% x
y <- 2:8; names(y) <- paste(y,":", sep = "")
outer(y, x, "^")
outer(month.abb, 1999:2003, FUN = "paste")
## three way multiplication table:
x %o% x %o% y[1:3]
# }