Skip to content
Prev 275899 / 398506 Next

element-by-element comparison

On 10/30/2011 02:51 PM, Wendy wrote:
Hi Wendy,
You probably mean something like this:

apply(B,2,`<`,A)

which means roughly
"To each column of B, apply the function `<` using A as the comparison 
values"

You will get a matrix of TRUE/FALSE values that are pretty much 
equivalent to your 0/1 values. Note that there are quite a few '*apply' 
functions and 'apply' is only guaranteed to work on arrays and matrices.

Jim