• python
  • javascript
  • reactjs
  • sql
  • c#
  • java
Facebook Twitter Instagram
Devs Fixed
  • python
  • javascript
  • reactjs
  • sql
  • c#
  • java
Devs Fixed
Home ยป Resolved: How to conditionally remove all rows associated with a factor/

Resolved: How to conditionally remove all rows associated with a factor/

0
By Isaac Tonny on 15/03/2023 Issue
Share
Facebook Twitter LinkedIn

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.
So here, only the rows related to 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 which all values of y are greater than 0

If you have better answer, please add a comment about this, thank you!

Source: Stackoverflow.com

dplyr if-statement r
Share. Facebook Twitter LinkedIn

Related Posts

Resolved: How can I implement a function depending on picked up items?

01/04/2023

Resolved: Azuer Service Bus SDK not receiving the specified messages

01/04/2023

Resolved: how to change date format from 201904 to Apr-19 in excel

01/04/2023

Comments are closed.

© 2023 DEVSFIX.COM

Type above and press Enter to search. Press Esc to cancel.