The last brace }
lacks an opening brace is the immediate cause. See the FAQ: How to do a minimal reproducible example reprex
for beginners for future reference.
There are also easier ways to do operations based on logical tests
suppressPackageStartupMessages({
library(dplyr)
})
mtcars %>% filter(mpg > 20 & cyl == 4 & hp > 100)
#> mpg cyl disp hp drat wt qsec vs am gear carb
#> Lotus Europa 30.4 4 95.1 113 3.77 1.513 16.9 1 1 5 2
#> Volvo 142E 21.4 4 121.0 109 4.11 2.780 18.6 1 1 4 2
Created on 2021-02-20 by the reprex package (v1.0.0)