Given two arrays
length(dim(a))==length(dim(b)), return a matrix with
pmax(dim(a),dim(b)) where “overlap”
a+b, and the other elements are either 0, a, or
b according to location. See details section.
numeric or complex arrays
The function takes any number of arguments (the binary operation is associative).
The operation of
aplus() is understandable by examining the
outa <- array(0,pmax(a,b))
outb <- array(0,pmax(a,b))
outa[1:dim(a)] <- a
outb[1:dim(a)] <- b
outb are the correct size and the
appropriate elements of each are populated with
respectively. Then the sum is returned.
Robin K. S. Hankin
1 2 3 4 5
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.