Skip to content
Prev 323237 / 398503 Next

[newbie] *apply to matching elements of n arrays?

Is the following what you want?   It works for vectors or arrays of
any number of dimensions.  It assumes that the dimensions of the
grids are the same.
[1]   1   2 103   3  NA

You don't really need the ' & !is.na(grid2)': it just stops the copying
of NA elements of grid2 to NA elements of grid1.

Bill Dunlap
Spotfire, TIBCO Software
wdunlap tibco.com