In this post, we will see how to resolve How to conditionally remove all rows associated with a factor/
Question:
In the dummy data, contains “3” sets of subdata. If any of the rows in the data is negative, then I want to completely remove all the rows associated with that set.1
is retained as all the values are positive. The other two sets need to be removed.Best Answer:
We can group by set, then filter only the groups in whichall
values of y
are greater than 0If you have better answer, please add a comment about this, thank you!
Source: Stackoverflow.com