I have a big correlation matrix and I want to get the column numbers of those columns with 1 in them (except the diagonal). Here is what I did that doesn't work:
# A toy example
m <- matrix(c(1,0,1,0,1,0,1,0,1), ncol = 3 , nrow = 3)
m <- m - diag(nrow(m)) #Removing 1's from the diagonal
col(m[which(m == 1)])
Is there any efficient solution for gigantic matrices?