Number format, writing 1e-5 instead of 0.00001

前端 未结 4 571
难免孤独
难免孤独 2020-12-03 10:25

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

4条回答
  •  再見小時候
    2020-12-03 10:53

    If the input is a mixture of scientific notation and explicit notation numbers, then you will be writing your own parser to read in the numbers and keep track of which ones were in which formats. In fact, you'll want to keep a string representation of those numbers lying around so you can write back exactly what was in the input.

    However, if you just want to write.table() with consistently explicit notation, try.

        write.table(format(_your_table_here_, scientific=FALSE), ...)
    

提交回复
热议问题