Skip to content

test function is insensitive for NaN vs NA difference #2960

Description

@jangorecki

For differentiating NA from NaN currently behavior of test function is consistent to all.equal while more appropriate IMO would be to expect identical behavior.

all.equal(NaN, NA_real_)
#[1] TRUE
identical(NaN, NA_real_)
#[1] FALSE

Unfortunately it is not that simple, we would need to overwrite all.equal.numeric to retain current features that comes from all.equal and be able to differentiate NA from NaN.

This ideally should be fixed upstream in R giving an option to differentiate both.

Activity

  1. added a commit that references this issue on Sep 21, 2019
    d0df453
  2. added this to the 1.12.4 milestone on Oct 1, 2019
  3. jangorecki commented on Aug 26, 2022

    @jangorecki
    MemberAuthor

    bump...
    just refreshing memory as I got hit by this again

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions