Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
fwrite fails to write 9.999999999999998 #1847
I tried to write a data.table to a file with fwrite, and noticed that the value of one column is not written.
dt <- data.table(V1=c(1), V2=c(9.9999999999999982236431605997495353221893310546875)) fwrite(dt, file="test.txt", sep=";")
The output file looks like this:
I expected it to look like this:
If I revert the column order, calling fwrite crashes my R session.
dt <- data.table(V2=c(9.9999999999999982236431605997495353221893310546875), V1=c(1)) fwrite(dt, file="test.txt", sep=";") # this causes R to crash
The details for the crash are (sorry about the German output, not sure how to change that to English):
My session info is as follows:
attached base packages:
other attached packages:
loaded via a namespace (and not attached):
data.table 1.9.7 IN DEVELOPMENT built 2016-09-11 14:38:19 UTC; travis