Skip to content
Prev 121349 / 398498 Next

remove NA rows and columns

Antje wrote:
testmatrix[!apply(is.na(testmatrix), 1, all),
           !apply(is.na(testmatrix), 2, all)]

     [,1] [,2]
[1,]    1    1
[2,]    2    2
[3,]    1    1
[4,]    2    2