outer(X, Y, FUN = "*", ...) X %o% Y
- X, Y
- First and second arguments for function
FUN. Typically a vector or array.
- a function to use on the outer products, found via
match.fun(except for the special case
- optional arguments to be passed to
Y must be suitable arguments for
FUN. Each will be extended by
rep to length the products of the lengths of
FUN is called.
FUN is called with these two extended vectors as arguments. Therefore, it must be a vectorized function (or the name of one), expecting at least two arguments.
Where they exist, the [dim]names of
Y will be copied to the answer, and a dimension assigned which is the concatenation of the dimensions of
Y (or lengths if dimensions do not exist).
FUN = "*" is handled internally as a special case, via
as.vector(X) %*% t(as.vector(Y)), and is intended only for numeric vectors and arrays.
%o% is binary operator providing a wrapper for
outer(x, y, "*").
Becker, R. A., Chambers, J. M. and Wilks, A. R. (1988) The New S Language. Wadsworth & Brooks/Cole.
Documentation reproduced from R 2.15.3. License: GPL-2.