Skip to content
Prev 59659 / 398502 Next

IFELSE across large array?

I'll give it half a crack:

Steps a through c can be done via nested ifelse(), treating A and M as
vectors (as they really are).  Step d is the hard one.  I'd write a simple
Fortran code and use .Fortran() for that.

I don't see how any of the *apply() functions can help here, as your
operations are element-wise, not dimension-wise.

Andy