How to remove all rows with NA from a matrix?

后端 未结 1 1388
时光取名叫无心
时光取名叫无心 2021-01-27 18:35

I have: A matrix y and it has two columns (the number of rows is different and depends on the input parameters). All the elements in the first

相关标签:
1条回答
  • 2021-01-27 19:18

    An example with some made up data:

    m <- matrix(c(1:3,c(1,NA,4)),ncol=2)
    m[!is.na(m[,2]),]
    
    0 讨论(0)
提交回复
热议问题