I think I figured out the reason.
When I call filter(mtcars, disp > 400)$mpgwhat actually happens:
`$`(filter(mtcars, disp > 400), mpg)
# [1] 10.4 10.4 14.7
Similarly, mtcars %>% filter(disp > 400)$mpginterpreted as:
`$`(mtcars, filter(disp > 400), mpg)
lhs of %>% rhs. , $ 2 , 3 .
# Error in mtcars$filter(disp > 400) :
# 3 arguments passed to '$' which requires 2
. mtcars data.frame filter(disp > 400) : mtcars$filter(disp > 400).