Explore the 1985 Cars Dataset task 10 R

in task 10 (Which cars have the highest miles per gallon on the highways? To find this, arrange the rows of mpg_exceeds_threshold by mpg_diff_from_threshold descending. Save this new dataframe as mpg_exceeds_threshold)

I keep getting this error message:

Error: Problem with `filter()` input `..1`.
ℹ Input `..1` is `mpg_diff_from_threshold`.
✖ Input `..1` must be a logical vector, not a double.

codes task 10

mpg_exceeds_threshold <- mpg_exceeds_threshold %>% filter(mpg_diff_from_threshold) %>% arrange(desc(mpg_diff_from_threshold))

task 9

 mpg_exceeds_threshold <- cars %>% filter(mpg_diff_from_threshold > 0)
head(mpg_exceeds_threshold)

Can someone tell me whats wrong ?

I’m very new to coding so someone can correct me if I’m wrong but the issue seems that you didn’t filter the mpg_diff_from_threshold dataframe by anything in task 10 (you didn’t apply a logical function). In task 9 you used the filter() function correctly.
For task 10 I did

filter(highway_mpg > 30)

The rest of the task 10 code seems fine.