I have the following problem, I have an array and I want to go through it and get the first line that has all elements other than zero. For example:
a = matrix(c(rep(0,4), 1:16), ncol = 4, byrow = T)
b = matrix(c(1:4, rep(0,4), 5:16), ncol = 4, byrow = T)
d = matrix(c(1:8,rep(0,4) , 9:16), ncol = 4, byrow = T)
The answer from "a" would be line 2, the answer from "b" would be line 1 and the answer from "d" would be line 1.
Thank you in advance.