Skip to content

[R-Forge #2660] Improve fread na.strings handling #504

Closed

Description

@arunsrinivasan

Submitted by: Matt Dowle; Assigned to: Nobody; R-Forge link

As raised here and here on SO.

Activity

  1. arunsrinivasan commented on Mar 16, 2015

    @arunsrinivasan
    MemberAuthor

    :bump:

  2. dselivanov commented on Jul 14, 2015

    @dselivanov

    @arunsrinivasan, @mattdowle today I had a look into this.
    Seems Strto*() functions family from fread.c should care about na.strings parameter. As of now the only one case is handled - "NA" strings. And the way this case handled is not very agile.

    if (lch==start && lch<eof-1 && *lch++=='N' && *lch++=='A' && (lch==eof || *lch==sep || *lch==eol)) {
            ch = lch;
            u.d = NA_REAL;
            return(TRUE);
        }

    If you agree that this is work for these functions (not just post-processing at the end readfile() function ) , I have ideas how to fix this.

  3. arunsrinivasan commented on Sep 7, 2015

    @arunsrinivasan
    MemberAuthor

    Thanks again for the excellent fix @dselivanov. Opened another issue, #1314, for na.strings="-999" like cases.

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions