Filtering out multiple columns in R

后端 未结 6 1574
难免孤独
难免孤独 2021-01-03 16:06

Supposing a data set with several rows and columns with some columns being 0 (I mean all values in the column are 0\'s). How one can filter out those columns? I have tried w

6条回答
  •  夕颜
    夕颜 (楼主)
    2021-01-03 16:51

    apply(df, 2, Filter, f = function(x){!all(x==0)})
    

    I had the same question.

提交回复
热议问题