I have a CSV (that I read in using fread from data.table) that has some rather large numbers in it which I convert to feather format and then save as a feather file, but when I read in this new file the numbers are totally different. This occurred on 777 different CSV files that I converted so it is not something specific to the CSV. I tried making a reproducible example but found that there was no issue if I generated the numbers in R.
Code with data from CSV:
options(digits = 22)
t<-tempfile()
i<-as.data.frame(data$total)
head(i)
x
1 10661832289
2 10836572665
3 11011492485
4 11180245212
5 11331994931
6 11486446777
feather::write_feather(i,t)
feather::read_feather(t)
# A tibble: 36 × 1
x
<dbl>
1 5.2676450557158410e-314
2 5.3539782724388232e-314
3 5.4404001462775578e-314
4 5.5237750713302844e-314
5 5.5987493942542471e-314
Reproducible code: Running this code does not result in the same problem. Thus it must be a retained class from reading in the CSV.
options(digits = 22)
t<-tempfile()
i<-as.data.frame(runif(10,10000000000,13000000000))
head(i)
feather::write_feather(i,t)
feather::read_feather(t)
My session info:
sessionInfo()
R version 3.3.3 (2017-03-06)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)
locale:
[1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252
[3] LC_MONETARY=English_United States.1252 LC_NUMERIC=C
[5] LC_TIME=English_United States.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] bit64_0.9-5 bit_1.1-12
loaded via a namespace (and not attached):
[1] lazyeval_0.2.0 plyr_1.8.4 assertthat_0.1 hms_0.3
[5] tools_3.3.3 haven_0.2.1 tibble_1.2 Rcpp_0.12.9
[9] feather_0.3.1 data.table_1.10.4 xlsxjars_0.6.1 rJava_0.9-8
[13] xlsx_0.5.7