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 as 1e-5
How can I keep the old format?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can do this by converting your numbers to strings with formatting as you require, then using the argument
quote = FALSEin the call towrite.table.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.