Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
+2 votes
5 views
in R Programming by (3.5k points)
edited by
I want to exclude specific participants from a DataFrame and create it from an existing DataFrame. I want a method to exclude it using multiple criteria. For example:- Excluding all men over 50 with low bp, I have tried subset() but it didn't worked for me.

1 Answer

0 votes
by (2k points)
edited by

Use this command:

df[!(df$gender == "men" & df$age > 50 & df$bp = "low"), ]

Just use this syntax to solve your problem. 

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...