I\'ve used read.table
to read a file that contains numbers such as 0.00001
when I write them back with write.table
those numbers appear a
You can do this by converting your numbers to strings with formatting as you require, then using the argument quote = FALSE
in the call to write.table
.
dfr <- data.frame(x = 10^(0:15))
dfr$y <- format(dfr$x, scientific = FALSE)
write.table(dfr, file = "test.txt", quote = FALSE)
Note that you shouldn't need to change the format of the numbers in your file. Pretty much every piece of scientific software and every spreadsheet understands scientific notation for numbers, and also has number formatting options so you can view them how you choose.