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. 

Welcome to Intellipaat Community. Get your technical queries answered by top developers!

30.5k questions

32.6k answers

500 comments

108k users

Browse Categories

...