outer2: Outer product of n-dimensional arrays

View source: R/utils.R

outer2R Documentation

Outer product of n-dimensional arrays

Description

The outer product of the arrays X, Y, ... with dimensions c(dim(X), dim(Y), ...); see outer.

Usage

outer2(..., FUN)

Arguments

...

arguments passed to FUN in the order given

FUN

a function to use on the outer products

See Also

outer; Vectorize

Examples

outer2(LETTERS[1:3], letters[1:3], LETTERS[24:26], FUN = paste0)
outer2(1:3, 1:3, 1:2, FUN = prod)

## three-way example in ?outer
x <- setNames(1:9, 1:9); y <- setNames(2:8, paste0(2:8, ':'))
x %o% x %o% y[1:3]
outer2(x, x, y[1:3], FUN = prod)


raredd/rawr documentation built on March 4, 2024, 1:36 a.m.