This is a shortcut for x >= left & x <= right, implemented efficiently in C++ for local values, and translated to the appropriate SQL for remote tables.

between(x, left, right)

Arguments

x

A numeric vector of values

left, right

Boundary values

Examples

x <- rnorm(1e2) x[between(x, -1, 1)]
#> [1] -0.86072428 0.42123042 0.19439244 -0.69120544 -0.94410166 -0.71605867 #> [7] 0.91107847 -0.77219209 -0.78207767 -0.43219524 -0.66756477 0.91187392 #> [13] 0.20538939 -0.78938814 0.58807712 -0.71128732 0.67638957 -0.23276176 #> [19] 0.63747287 -0.68326687 -0.97967535 -0.46251911 0.74786883 -0.80534353 #> [25] 0.77599004 0.70359786 0.71540139 0.40152349 0.40427794 -0.77705556 #> [31] -0.28045548 0.29738725 -0.23564615 0.04433469 -0.32849189 0.46205231 #> [37] 0.69362435 -0.70859443 -0.20889688 0.35227917 -0.77928540 0.70005531 #> [43] 0.11759261 -0.28362275 0.49790884 0.38624909 0.71752478 0.13191018 #> [49] -0.92066340 0.26726762 -0.23854626 -0.78447669 -0.82776894 0.94433756 #> [55] -0.63969296 -0.21714460 0.57991478 -0.95260348 -0.96767371 0.79245114 #> [61] -0.93697260 0.86130054