R 超过2列的重叠-2个标准

R 超过2列的重叠-2个标准,r,data.table,R,Data.table,我使用foverlaps通过一列的值连接两个表。我面临的问题是,我达到了行数的限制(获取“不允许使用负长度向量”错误)。 解决这个问题的方法(我的计划)是在匹配时引入一个新的标准 DT1 质量时间 100 0 100-tol 100+tol 101 0 101-tol 101+tol 100 1 100-tol 100+tol 101 1 101-tol 101+tol 100 2 100-tol 100+tol 101 2 101-tol 101+tol 图书馆 Mass Time

我使用foverlaps通过一列的值连接两个表。我面临的问题是,我达到了行数的限制(获取“不允许使用负长度向量”错误)。 解决这个问题的方法(我的计划)是在匹配时引入一个新的标准

DT1

质量时间
100 0 100-tol 100+tol
101 0 101-tol 101+tol
100 1 100-tol 100+tol
101 1 101-tol 101+tol
100 2 100-tol 100+tol
101 2 101-tol 101+tol
图书馆

Mass    Time    <other cols>  <min mass> <max mass> 
100.1   0.5                   100.1      100.1     
100.9   0.9                   100.1      100.1  
Mass    Time    <other cols>  <min mass> <max mass> <min Time> <max Time>
100.1   0.5                   100.1      100.1      0.5        0.5
100.9   0.9                   100.1      100.1      0.5        0.5
质量时间
100.1   0.5                   100.1      100.1     
100.9   0.9                   100.1      100.1  
我正在按最小最大质量键控2个DTs,并运行foverlaps(DT1,库)。当未达到极限时,所有功能均正常工作

在做翻车时,有没有办法使用两个标准?或者我应该如何思考这个问题? 我在excel中所做的匹配如下:

DT1

质量时间
100 0 100-tol 100+tol 0-timeTol 0+timeTol
101 0 101-tol 101+tol 0-timeTol 0+timeTol
100 1 100-tol 100+tol 1-timeTol 1+timeTol
101 1 101-tol 101+tol 1-timeTol 1+timeTol
100 2 100-tol 100+tol 2-timeTol 2+timeTol
101 2 101-tol 101+tol 2-timeTol 2+timeTol
图书馆

Mass    Time    <other cols>  <min mass> <max mass> 
100.1   0.5                   100.1      100.1     
100.9   0.9                   100.1      100.1  
Mass    Time    <other cols>  <min mass> <max mass> <min Time> <max Time>
100.1   0.5                   100.1      100.1      0.5        0.5
100.9   0.9                   100.1      100.1      0.5        0.5
质量时间
100.1   0.5                   100.1      100.1      0.5        0.5
100.9   0.9                   100.1      100.1      0.5        0.5

我从您的数据推断,在
库中
可变质量=最小质量=最大质量,时间=最小时间=最大时间。如果这是正确的,您可以进行非等联接。类似于
librarY[DT1,on=。(Mass>=min\u Mass,Mass=min\u time,times,直到得到相同的错误,所以我需要不断重新定义我的间隔。但是,与foverlaps相比,此解决方案的速度非常慢。你的foverlaps在两个重叠的间隔上工作吗?