1
votes

I want to filter a column in a dataframe which is weather condition line rainy, clear... and contains characters.

` min1$Rainy <- filter(min1$Conditions == "Light Rain")`

I tried the codes above but I faced to this error:

Error in UseMethod("filter_") : no applicable method for 'filter_' applied to an object of class "logical"

How can I solve it? Appreciate for your time.

1
Welcome to StackOverflow! Please read the info about how to ask a good question and how to give a reproducible example. This will make it much easier for others to help you. - Jaap
min1$Rainy is a column while filter produces a dataframe, so how do you want to store a dataframe into a column? - acylam

1 Answers

4
votes

As filter is part of the tidyverse family, it follows the standard tidyverse interface. The first argument needs to be a tbl_df (data frame).