Skip to content

all.equal.data.table throws "Dataset 'current' has rows not present in 'target'" when double precision values are numerically, but not exactly, equal #7816

Description

@kjellpk

When ignore.row.order = TRUE, all.equal.data.table throws' "Dataset 'current' has rows not present in 'target'" when there are multiple double precision columns and any but the last one are not perfectly equal.

> library(data.table)
data.table 1.18.4 using 5 threads (see ?getDTthreads).  Latest news: r-datatable.com

Attaching package: ‘data.table’

The following object is masked from ‘package:base’:

    %notin%

> eps <- sqrt(.Machine$double.eps) / 3.0
>
> x <- data.table(a = "a", ione = 1L, done = 1.0, dtwo = 2.0)
> y <- copy(x)
> y[, done := done - eps]
> all.equal(x, y, ignore.row.order = TRUE)
[1] "Dataset 'current' has rows not present in 'target'"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions