You can create three explicit filters for the three different lags, although this requires repetition of similar code. Note that the lag function below is the dplyrlag function rather than the baselag function.
You can iterate over the lags using map, which saves some typing and increases flexibility if you want to create a function that can take arbitrary numbers of lags and lag values:
The default argument determines what to do with missing values. The default for default is NA. In my first attempt at answering your question, I needed to set default to a number, but it's not necessary in the code above and I've removed it.
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:
Be cautious when relying on implicit ordering of rows (or columns or elements in a vector). Usually, there's another way that clarifies the goal and survives minor changes to input.