Hello. I have this matrix:
cy [,1] [,2] [,3] [,4] [,5] [,6] [1,] 1.0000000 1.0000000 -0.5164570 -0.5164087 -0.4004139 -0.4003719 [2,] 1.0000000 1.0000000 -0.5164570 -0.5164087 -0.4004139 -0.4003719 [3,] -0.5164570 -0.5164570 1.0000000 1.0000000 -0.1186691 -0.1186972 [4,] -0.5164087 -0.5164087 1.0000000 1.0000000 -0.1186995 -0.1187276 [5,] -0.4004139 -0.4004139 -0.1186691 -0.1186995 1.0000000 1.0000000 [6,] -0.4003719 -0.4003719 -0.1186972 -0.1187276 1.0000000 1.0000000 [7,] -0.4058070 -0.4058070 -0.1150400 -0.1150706 0.9999826 0.9999824 [8,] -0.4061715 -0.4061715 -0.1147942 -0.1148249 0.9999802 0.9999799 [9,] -0.4061804 -0.4061804 -0.1147882 -0.1148189 0.9999801 0.9999799 [10,] 1.0000000 1.0000000 -0.5164570 -0.5164087 -0.4004139 -0.4003719 [,7] [,8] [,9] [,10] [1,] -0.4058070 -0.4061715 -0.4061804 1.0000000 [2,] -0.4058070 -0.4061715 -0.4061804 1.0000000 [3,] -0.1150400 -0.1147942 -0.1147882 -0.5164570 [4,] -0.1150706 -0.1148249 -0.1148189 -0.5164087 [5,] 0.9999826 0.9999802 0.9999801 -0.4004139 [6,] 0.9999824 0.9999799 0.9999799 -0.4003719 [7,] 1.0000000 0.9999999 0.9999999 -0.4058070 [8,] 0.9999999 1.0000000 1.0000000 -0.4061715 [9,] 0.9999999 1.0000000 1.0000000 -0.4061804 [10,] -0.4058070 -0.4061715 -0.4061804 1.0000000 I want to know the coordinates of the 1's only in the cy's lower triangle. If I do cy%in%1 or cy ==1 I have this result: [1] TRUE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE TRUE [13] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE TRUE FALSE [25] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE TRUE FALSE FALSE [37] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE TRUE FALSE FALSE FALSE [49] FALSE FALSE FALSE FALSE FALSE FALSE FALSE TRUE FALSE FALSE FALSE FALSE [61] FALSE FALSE FALSE FALSE FALSE FALSE TRUE FALSE FALSE FALSE FALSE FALSE [73] FALSE FALSE FALSE FALSE FALSE TRUE FALSE FALSE FALSE FALSE FALSE FALSE [85] FALSE FALSE FALSE FALSE TRUE FALSE FALSE FALSE FALSE FALSE FALSE FALSE [97] FALSE FALSE FALSE TRUE It seems that is only considering the principal diagonal. I don't understand why... Thank you, Rui [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.