Hello

I have 4 1000*1000 matrix A,B,C,D. I want to use the corresponding element of the 4 matrices. Using the "for loop" as follow:

E<-o
for (i in 1:1000)
    {for (j in 1:1000)
 {
         E<-fisher.test(matrix(c(A[i][j],B[i][j],C[i][j],D[i][j]),2))#call fisher.test for every element
 }
    }

It is so time-consuming
Need vectorization

Yours sincerely




ZhaoXing
Department of Health Statistics
West China School of Public Health
Sichuan University
No.17 Section 3, South Renmin Road
Chengdu, Sichuan 610041
P.R.China

	[[alternative HTML version deleted]]


__________________________________________________
8O?lW"2aQE;"3,4sH]A?Cb7QSJOd?

