Reputation: 960
I have a dataset with some large numbers:
require(pacman)
p_load(bit64,
feather,
data.table)
sampleDT <- data.table(ID = c(1,2,3),
Val = c(11111111111,2222222222,3333))
sampleDT[, Val := bit64::as.integer64(Val)] # convert it to integer64 type
sampleDT # result looks fine
ID Val
1: 1 11111111111
2: 2 2222222222
3: 3 3333
However, when I use R feather to save this data and reload, the large numbers are not preserved.
feather::write_feather(x = sampleDT, path = "C:/Users/xxx/Downloads/test.feather")
resultDT <- feather::read_feather(path = "C:/Users/xxx/Downloads/test.feather")
resultDT
# A tibble: 3 x 2
ID Val
<dbl> <dbl>
1 1 5.49e-314
2 2 1.10e-314
3 3 1.65e-320
Is this a genuine issue with integer64 type? What should I do to preserve this large numbers?
Upvotes: 1
Views: 93