I have a large R data.table
with a multi column key, where some value columns contain some NA. I\'d like to remove groups that are entirely NA in one or more value
What about using complete.cases
function ?
DT[complete.cases(DT),]
It will drop the rows that have a column value with NA
> DT[complete.cases(DT),]
Series Id Value1 Value2
1: b 4 4 1
2: b 5 5 2
3: b 6 6 3
4: c 7 7 4
5: c 8 8 5
6: c 9 9 6
7: f 4 4 1
8: f 5 5 2
9: f 6 6 3
10: g 7 7 4
11: g 8 8 5
12: g 9 9 6
13: j 4 4 1
14: j 5 5 2
15: j 6 6 3
16: k 7 7 4
17: k 8 8 5
18: k 9 9 6