Re: [R] Help with applying a function to all possible 2x2 submatrices

2012-10-22 Thread CMB123
I apologize if the term "submatrix" was confusing - I am basically 2 rows and 2 columns from a r x c matrix to construct 2x2 matricies. Thus, the choose(r,2) * choose(c,2) possible combinations. For each matrix [(a,b), (c,d)], I am testing a > b, b > d, d > c, and c > a. For the sake of simplicity

[R] Help with applying a function to all possible 2x2 submatrices

2012-10-22 Thread CMB123
Hi all, I'm working with a large data set (on the order of 300X300) and trying to apply a function which compares the elements of all possible 2x2 submatrices. There are rc(r-1)(c-1) such submatrices, so obviously the naive method of looping through the rows and columns is computationally unfeasib