Foverlaps错误:if(any [x [[xintervals [2L]]] - x [[xintervals [1L]]]

时间:2021-11-04 16:12:36

I can successfully use foverlaps with a small sample of my dataset, but when use the full data (data.tables with over 30k rows), it breaks down and throws the following error:

我可以使用我的数据集的一小部分样本成功使用foverlaps,但是当使用完整数据(data.tables超过30k行)时,它会崩溃并抛出以下错误:

Error message:

Error in if (any(x[[xintervals[2L]]] - x[[xintervals[1L]]] < 0L)) stop("All entries in column ",  :
  missing value where TRUE/FALSE needed

The way I am interpreting the error message is that there are no overlaps between the two data.tables.

我解释错误消息的方式是两个data.tables之间没有重叠。

Q1-Am I interpreting the message well?

Q1-Am我能很好地解释这个消息吗?

Q2-Any idea why this might happen with the larger dataset? Is it possible that this is due to the size of the dataset?

Q2 - 任何想法为什么这可能发生在更大的数据集上?这可能是由于数据集的大小造成的吗?

I do have a lot of unique values, which according to foverlaps help file, can be expected to slow things down proportionally, but not before it get into millions of rows, which is far from being the case here. Thank you.

我确实有很多独特的值,根据foverlaps帮助文件,可以预期按比例减慢速度,但不会在它进入数百万行之前,这远不是这里的情况。谢谢。

1 个解决方案

#1


There is no reproducible example so it is not possible to investigate your issue.
As stated by Carl in comment it is likely caused by NA values present in input.
In the recent development version there has been some improvements made to foverlaps by Arun. One of those improvements is better error message when NA values are detected.
To install recent development version use the following call.

没有可重复的示例,因此无法调查您的问题。正如Carl在评论中所述,它可能是由输入中存在的NA值引起的。在最近的开发版本中,Arun对foverlaps进行了一些改进。当检测到NA值时,其中一项改进是更好的错误消息。要安装最新的开发版本,请使用以下调用。

install.packages("data.table", repos="https://Rdatatable.gitlab.io/data.table")

This feature is going to be soon published to CRAN as 1.12.2.

该功能将很快发布到CRAN 1.12.2。

#1


There is no reproducible example so it is not possible to investigate your issue.
As stated by Carl in comment it is likely caused by NA values present in input.
In the recent development version there has been some improvements made to foverlaps by Arun. One of those improvements is better error message when NA values are detected.
To install recent development version use the following call.

没有可重复的示例,因此无法调查您的问题。正如Carl在评论中所述,它可能是由输入中存在的NA值引起的。在最近的开发版本中,Arun对foverlaps进行了一些改进。当检测到NA值时,其中一项改进是更好的错误消息。要安装最新的开发版本,请使用以下调用。

install.packages("data.table", repos="https://Rdatatable.gitlab.io/data.table")

This feature is going to be soon published to CRAN as 1.12.2.

该功能将很快发布到CRAN 1.12.2。