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!

29.3k questions

30.6k answers

501 comments

104k users

Browse Categories

...