简体   繁体   中英

Foverlaps error: Error in if (any(x[[xintervals[2L]]] - x[[xintervals[1L]]] < 0L)) stop

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:

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.

Q1-Am I interpreting the message well?

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

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.

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.

install.packages("data.table")

This feature is already on CRAN as of 1.12.2.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM