how to see if any element of a list contains only a certain value in R

I have a list of many matrices, let say my_list. I want to check if any of those matrices has only zero s as its element and if so which matrix in that list has such situation.

output_vec <- vector()
for(i in 1:length(my_list)){

this gives me true falses but, I am not able to return the index of matrices with all zero elements. I appreciate any help with this.

Read more here:

Content Attribution

This content was originally published by Mathica at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: