-
-
Save stephlocke/667ce7f84406f7094587 to your computer and use it in GitHub Desktop.
foverlaps multiple column check
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(data.table) | |
x<-data.table(a=c(1,2),a1=c(1,2), | |
b=c(1,2),b1=c(1,2), | |
c=c(1,2),c1=c(1,2)) | |
y<-data.table(mina=0,maxa=3, | |
minb=0,maxb=3, | |
minc=0,maxc=3) | |
## Does work | |
setkey(y,mina,maxa) | |
setkey(x,a,a1) | |
foverlaps(x,y, which=TRUE) | |
## Doesn't work | |
setkey(y,mina,maxa,minb,maxb) | |
setkey(x,a,a1,b,b1) | |
foverlaps(x,y, which=TRUE) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment