> X abc 1: 1 6 5 2: 2 7 4 3: 3 8 3 4: 4 9 2 5: 5 10 1
Using the example in the comments:
> X[a %between% list(c, b)] abc 1: 3 8 3 2: 4 9 2 3: 5 10 1 > X[a %inrange% list(c, b)] abc 1: 1 6 5 2: 2 7 4 3: 3 8 3 4: 4 9 2 5: 5 10 1
It seems that between looks at each line separately and checks if the value in is such that c <= a <= b for that line.
inrange searches for the smallest scalar value in c , say cmin and the largest scalar value in b , bmax , forming the range [cmin, bmax] , and then checks if a exists in this range [cmin, bmax] for each row in column a .
Quantitative Melancholy
source share