If you're checking row numbers, might as well use slice:
library(magrittr)
mtcars %>% slice(
which(near(mpg, 22.8)) %>%
mapply(FUN = add, list(0:2))
)
One nice thing about slice is that you don't need to check for intersection with row_number; it will just ignore numbers outside the range. So, with mtcars having 32 rows, slice(mtcars, 30:35) gives rows 30-32.
If you don't want to load magrittr, then FUN = "+" or FUN = `+` should work.
If you have magrittr loaded, you can also use it to inspect the object passed to slice using %T>%, which I find useful for debugging:
> mtcars %>% slice(
+ which(near(mpg, 22.8)) %>%
+ mapply(FUN = add, list(0:2)) %T>% print
+ )
[,1] [,2]
[1,] 3 9
[2,] 4 10
[3,] 5 11
# A tibble: 6 x 11
mpg cyl disp hp drat wt qsec vs am gear carb
<dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
1 22.8 4 108.0 93 3.85 2.320 18.61 1 1 4 1
2 21.4 6 258.0 110 3.08 3.215 19.44 1 0 3 1
3 18.7 8 360.0 175 3.15 3.440 17.02 0 0 3 2
4 22.8 4 140.8 95 3.92 3.150 22.90 1 0 4 2
5 19.2 6 167.6 123 3.92 3.440 18.30 1 0 4 4
6 17.8 6 167.6 123 3.92 3.440 18.90 1 0 4 4