Using a pipe to sequentially filter data - receiving error

Your error has to do with the very last filter argument.

You need to use == for equality or != for not equal to.

Additionally, I think your understanding is slightly backward for filter. The way it is written now it will only return values that are greater than 3.5 and greater than 2 and so on. filter by default returns everything that meets the conditions given, it does not remove them. So you will need to rework it slightly to get what you want.

Also, as I mentioned on your previous thread, formatting code makes it much easier to read. Please follow the instructions below when you post any code in the future. In addition to helping you get the help you want. It helps keep the community clean and tidy (pun intended)

In the future please put code that is inline (such as a function name, like mutate or filter) inside of backticks (`mutate`) and chunks of code (including error messages and code copied from the console) can be put between sets of three backticks:

```
example <- foo %>%
  filter(a == 1)
```

This process can be done automatically by highlighting your code, either inline or in a chunk, and clicking the </> button on the toolbar of the reply window!

This will help keep our community tidy and help you get the help you are looking for!

For more information, please take a look at the community's FAQ on formating code

1 Like