# between

From data.table v1.7.1
by M Dowle and T Short

##### Convenience function for range subset logic.

Intended for use in [.data.table i.

- Keywords
- data

##### Usage

```
between(x,lower,upper,incbounds=TRUE)
x
```

##### Arguments

- x
- Any vector e.g. numeric, character, date, ...
- lower
- Lower range bound.
- upper
- Upper range bound.
- incbounds
`TRUE`

means inclusive bounds i.e. [lower,upper].`FALSE`

means exclusive bounds i.e. (lower,upper).

##### Value

- Integer vector containing the locations of
`x`

which lie within the range [lower,upper] or (lower,upper).

##### Note

Current implementation does not make use of ordered keys.

##### See Also

##### Examples

```
DT = data.table(a=1:5, b=6:10)
DT[b %between% c(7,9)]
```

*Documentation reproduced from package data.table, version 1.7.1, License: GPL (>= 2)*

### Community examples

Looks like there are no examples yet.