Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[R-Forge #5399] %between% could be vectorised #534

Closed
arunsrinivasan opened this issue Jun 8, 2014 · 2 comments
Closed

[R-Forge #5399] %between% could be vectorised #534

arunsrinivasan opened this issue Jun 8, 2014 · 2 comments
Assignees
Milestone

Comments

@arunsrinivasan
Copy link
Member

Submitted by: Michele Carriero; Assigned to: Nobody; R-Forge link

As implemented now

between(x, y[1], y[2], incbounds = TRUE)

%between% has only a single upper and lower bound. Replacing its body with

between(x, y[[1]], y[[2]], incbounds = TRUE)

would allow the current usage plus a vectorised usage. Like:

dt[ colA %between% list(colB, colC)]

@arunsrinivasan
Copy link
Member Author

Hm, currently between() checks which values of x is between y and z (length=1 as it were before this commit). In that sense, if it has to be vectorised, then the Q we could instead ask is:

Is x between any of the ranges between y and z?

In essence, we could promote current vectorised behaviour to do even more -- true range join/subset. Will do and then close.

@arunsrinivasan arunsrinivasan reopened this Apr 6, 2016
@arunsrinivasan
Copy link
Member Author

Implemented new function anywhere() that does a range join.. See #679

worker000000 pushed a commit to worker000000/data.table that referenced this issue Aug 13, 2017
worker000000 pushed a commit to worker000000/data.table that referenced this issue Aug 13, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant