Computes the outer product of two numeric or character arrays.

x %outer% y

Arguments

x

numeric or character array.

y

numeric or character array.

Value

array.

Details

The outer product between two arrays A and B is computed as: $$C_{i_1\dots i_mj_1\dots j_n} = A_{i_1\dots i_m}B_{j_1\dots j_n}$$

References

Guidotti, E. (2020). "calculus: High dimensional numerical and symbolic calculus in R". https://arxiv.org/abs/2101.00086

See also

Other basic arithmetic: %diff%(), %div%(), %dot%(), %inner%(), %kronecker%(), %prod%(), %sum%()

Examples

### numeric outer product c(1,2) %outer% c(2,3)
#> [,1] [,2] #> [1,] 2 3 #> [2,] 4 6
### symbolic outer product c("a","b") %outer% c("c","d")
#> [,1] [,2] #> [1,] "(a) * (c)" "(a) * (d)" #> [2,] "(b) * (c)" "(b) * (d)"