[R] Using apply with more than one matrix

Waichler, Scott R Scott.Waichler at pnnl.gov
Wed Apr 30 19:54:48 CEST 2014


Hi,

I want to apply a custom function to all the elements of one matrix.  The function uses the value in the same i,j in a second matrix.  How can I use apply() or similar function to avoid nested loops in i and j?

Thanks,
Scott Waichler
Pacific Northwest National Laboratory
Richland, WA, USA



More information about the R-help mailing list