fread() fails with missing values in integer64 columns

前端 未结 2 1125
感情败类
感情败类 2021-02-14 07:53

When reading the text below, fread() fails to detect the missing values in columns 8 and 9. This is only with the default option integer64=\"integer64\"

2条回答
  •  耶瑟儿~
    2021-02-14 08:30

    This bug, #488, is now fixed with this commit in development version of data.table v1.9.5, and values are assigned (and displayed) properly as NA if bit64 is loaded.

    require(data.table) # v1.9.5
    require(bit64)
    ans = fread("test.csv")
    #      V1  V2 V3 V4 V5  V6 V7         V8         V9        V10 V11
    # 1: 2012 276 NA  0 S1 001  1         NA  724135215 1590915056  NA
    # 2: 2012 276  2  8 S1 001  1         NA         NA     154598   0
    # 3: 2012 276  2 12 S1 001  1         NA    5118863   21819477  NA
    # 4: 2012 276  2  0 S1 011  8 3127133583 3127133583 9003982501   0
    

提交回复
热议问题