如何在R中删除NULL / Zero(0)的行

时间:2016-11-30 09:25:29

标签: r

     CampActID  AccountID           LocationName    LocationID
       <int>     <chr>                    <chr>      <int>
1         12         3            Mark + Brandy          3
2         12        15                     NULL          0
3         12       102                 Spuntino        100
4         12       126                     NULL          0
5         12       128 Intersport Concept Store        312
6         12        15                     NULL          0
7         12        48              Aspeli Dame         46
8         12        75            Albert Bistro         73
9         12       126                     NULL          0
10        12       128 Intersport Concept Store        312

1 个答案:

答案 0 :(得分:0)

我们可以尝试

library(dplyr)
df1%>%
   filter(LocationName != "NULL" & LocationID!=0)