The problem is the following
There is avector
k<-sample(1:100000,1000)
sort(k)->k
Then there is a matrix with ranges like
l<-c(1,100)
l1<-c(250,1000)
l3<-c(30000,60000)
l4<-c(80000,90000)
rbind(l,l1)->l
rbind(l3,l4)->ll
rbind(l,ll)->ll
ll->l3
Now I do have to find those numbers which are in the ranges of the table (like 1-100, or 30000 to 60000). Currently I use
indx <- sapply(k, function(x) any(x >= l3[,1] & x <= l3[,2]))
that is slow for a table (l3) with over 60k lines - is there any quicker way maybe?