0

I'm trying to write my R output as a text file. R converts all the larger numbers into scientific characters. How do I write the output the results as it is? eg: I want 283187433.2 as it is not as 2.8E+08.

I tried using options(digits=20) but it converts ALL the numbers into 20 digits (eg:46100000.0000000000000)

Jana
  • 1,523
  • 3
  • 14
  • 17
  • 1
    Previously answered http://stackoverflow.com/questions/5352099/how-to-disable-scientific-notation-in-r – cdeterman Sep 02 '14 at 20:02
  • It seems likely that this is a dupe, but That one was not addressing output to a file or formating of the decimal fraction. – IRTFM Sep 02 '14 at 20:07
  • @Jana I'm not sure this is a duplicate. I will reopen this question if you post the code you were using. When I use `write.table(283187433.2, file="test.dat")` the output does not exhibit the behavior you were describing. – IRTFM Sep 02 '14 at 20:40

1 Answers1

0
  print( format(283187433.2, nsmall=1), quote=FALSE)
 #[1] 283187433.2

Ouput to the console but this would also be what you saw in a text file.

write.table(file="", 283187433.2, quote=FALSE, row.names=FALSE, col.names=FALSE)
283187433.2
IRTFM
  • 258,963
  • 21
  • 364
  • 487