>> R-code

test <- matrix(0, 6118, 1)

pregene <- matrix(0, 1148, 7) 

test[,1] <- sqrt(apply(spomodel^2, 1, sum)/7)  ## spomodel is a matrix, 6118
rows, 7 columns

 

num <- matrix(0, 1148, 1)

 

j <- 0

 

for(i in 1:6118){

    if(test[i,1] > 1.13){

        j <- j + 1

        pregene[j,] <- spomodel[i,]  --->> 1)

    }

}

Error: incorrect number of subscripts on matrix

----->> End of R code

 

Without 1) line, this code exactly run.

But it cause the error including 1) line.

I don't know why this error messange was caused.

In S - plus this code including 1) line was executed . 

In advance,  I am really appreciate of your help.

 

 


	[[alternative HTML version deleted]]


