Filter something from dataframe in an order in R

+1 vote
I have a data frame and I need to filter out one field in a particular order. Is that possible?
Dec 13, 2018 in Data Analytics by Ali
• 11,360 points
472 views

1 answer to this question.

0 votes

You can use conditional filtering for this purpose. Something like:

df[!(df$gender == "woman" & df$age > 40 & df$bp = "high"), ]

where df is the dataframe which has three variables - gender, age and bp. Hope this helps.

answered Dec 13, 2018 by Maverick
• 10,840 points

Related Questions In Data Analytics

0 votes
1 answer

Reshape dataframe without “timevar” from long to wide format in R

Assuming that the data is in the ...READ MORE

answered Jun 14, 2018 in Data Analytics by CodingByHeart77
• 3,740 points
823 views
0 votes
1 answer

Store a built in dataset or dataframe from R to database

dbWriteTable() function allows you to store data ...READ MORE

answered Jul 30, 2019 in Data Analytics by anonymous
• 33,030 points
804 views
0 votes
1 answer

Read from database and store in R as dataframe

Your code would fetch you a MySQL ...READ MORE

answered Jul 30, 2019 in Data Analytics by anonymous
• 33,030 points
869 views
0 votes
1 answer

Create an animation from images in R

Create a vector with all frames required ...READ MORE

answered Aug 7, 2019 in Data Analytics by anonymous
• 33,030 points
550 views
+10 votes
3 answers

Which is a better initiative to learn data science: Python or R?

Well it truly depends on your requirement, If ...READ MORE

answered Aug 9, 2018 in Data Analytics by Abhi
• 3,720 points
1,145 views
+1 vote
1 answer

Error saying "vector size cannot be NA" when using R with data mining

You can use the removesparseterm function.  Removes sparse ...READ MORE

answered Nov 15, 2018 in Data Analytics by Maverick
• 10,840 points
4,390 views
+1 vote
2 answers
0 votes
1 answer

Trying to find frequent itemsets of a data set using arules package

Try replacing ID <- c("A123","A123","A123","A123","B456","B456","B456") item <- c("bread", "butter", "milk", ...READ MORE

answered Nov 15, 2018 in Data Analytics by Maverick
• 10,840 points
568 views
0 votes
1 answer

How is R applied in real world?

R Programming gives a broad variety of ...READ MORE

answered Oct 29, 2018 in Data Analytics by Maverick
• 10,840 points
1,342 views
+1 vote
1 answer

Difference between factor and as.factor in R programming

Hey @Ali, as.factor is a wrapper for ...READ MORE

answered Oct 29, 2018 in Data Analytics by Maverick
• 10,840 points
4,510 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP