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).
r list matrix remove drop
Add a comment
|