remove matrix from a list of matrices

6

I have a list of 12 matrices called M and I'm trying to remove every matrix from the list that has 0 rows.

I know that I can manually remove those matrices with (for example, to remove the second matrix) M[2] <- NULL. I would like to use logic to remove them with something like: M <- M[nrow(M)>0,] (but that obviously didn't work).

Share
Improve this question

Comments

Popular posts from this blog

Meaning of `{}` for return expression

Get current scroll position of ScrollView in React Native

flutter websocket connection issue