outer(X, Y, FUN="*", ...)X %o% Y #operator form
z <- x %o% y # The outer product array # dim(z) == c(dim(as.array(x)), dim(as.array(y)))# simulate a two-way table outer(c(3.1, 4.5, 2.8, 5.2), c(2.7, 3.1, 2.8),"+") + matrix(rnorm(12), nrow=4)
z <- outer(months, years, paste) # All month, year combinations pasted.