I have a file that has a matrix of 500 rows (binary scores) and 120 columns. The file is a simple matrix of 0s and 1s.
>file
00010010101010
01001010100101
00101001010001
11110101001010
I am writing a function that uses a special correlation formula to find this correlation between the rows. It takes two vector rows as input fn(row1, row2). eg. row1 and row2 and calculates this special correlation.
Example
>fn(file[1,], file[2,])
>0.32
I am able to do it for two rows but how can I create a 500x500 correlation matrix for all rows. Can someone please help with this? Thanks.