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.
1is 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 which
yare greater than 0
If you have better answer, please add a comment about this, thank you!