Preserving large numbers

后端 未结 8 1791
一生所求
一生所求 2020-12-01 18:30

I am trying to read a CSV file that has barcodes in the first column, but when R gets it into a data.frame, it converts 1665535004661 to 1.67E+12.<

8条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-01 18:59

    From the ?is.integer page:

    "Note that current implementations of R use 32-bit integers for integer vectors, so the range of representable integers is restricted to about +/-2*10^9?

    1665535004661L > 2*10^9 [1] TRUE

    You want package Rmpfr.

    library(Rmpfr)
    x <- mpfr(15, precBits= 1024)
    

提交回复
热议问题