The original numbers are integers from 825010211307012
to 825010304926185
. fread()
turns all those numbers to 4.076092e-309
.
read.table
works normally, but I need to read large data so I can't use it.
How can I correct this error?
答案 0 :(得分:3)
如果您安装了bit64
包,那么fread
将使用它来读取这些大整数:
之前:
> fread("./bignums.txt")
V1
1: 4.076092e-309
2: 4.076092e-309
做魔术:
> install.packages("bit64")
然后:
> fread("./bignums.txt")
V1
1: 825010211307012
2: 825010304926185
fread
已将它们读入64位整数:
> fread("./bignums.txt")$V1
integer64
[1] 825010211307012 825010304926185
我不知道fread
在bit64
不可用时误导他们的原因。我至少期待一个警告...