Filters vector `x`

to only keep elements which are in bounds `[lower, upper]`

.
This is equivalent to the following, but tries to avoid unnecessary allocations:

`!is.na(x) & x >= lower & x <= upper] x[`

Currently only works for integer `x`

.

## Arguments

- x
(

`integer()`

)

Vector to filter.- lower
(

`integer(1)`

)

Lower bound.- upper
(

`integer(1)`

)

Upper bound.

## Examples

```
keep_in_bounds(sample(20), 5, 10)
#> [1] 8 9 10 5 7 6
```