Displaying 1 result from an estimated 1 matches for "tp3312748p3312780".
2011 Feb 18
4
Matrix in R
Hi everyone,
I'm building a matrix in R with a cycle for like this:
pp_ris2=matrix(NA,6,6)
for(i in 0:6){
for(j in 0:6){
if(i>j){
pp_ris2[i,j]=myfunction}
else if(i==j){
print(c(i,j))
pp_ris2[i,j]=myfunction}
}}
but the result is:
[,1] [,2] [,3] [,4] [,5] [,6]
[1,] 0.062 NaN NaN NaN NaN NaN
[2,] 0.083 0.022 NaN NaN NaN NaN
[3,]