I have run into an issue where even when I disable exponential notation, fwrite
prints the number in exponential notation. An example:
library(data.table)
options(scipen = 999)
testint = c(500000)
Before I print, r
behaves and does not print in exponential notation:
print(testint)
[1] 500000
print(list(testint)
[[1]]
[1] 500000
But when I do:
fwrite(list(testint), "output")
The content of the file is 5e+05. I suspect this issue may specifically be with fwrite
, as when I do:
write(testint, "output1")
The content of the output file is 500000.
Is there any way to prevent fwrite
from doing this? I could switch to using write
, but there is a massive speed difference between them and I am writing a lot of data, so there would be a significant performance impact that I would like to avoid if possible. Thanks!
Edit: if anyone is interested, there is an existing open github issue here that I found after I asked the question!