Skip to content

How to export data with defined decimal places

7 messages · Marino David, Bert Gunter, Jorge I Velez

#
?write.table

which says, under details:

"In almost all cases the conversion of numeric quantities is governed
by the option "scipen" (see options), but with the internal equivalent
of digits=15. For finer control, use format to make a character
matrix/data frame, and call write.table on that. "

Not sure if this is what you want, as "export" is rather vague.

-- Bert
On Thu, Mar 7, 2013 at 12:52 PM, Marino David <davidmarino838 at gmail.com> wrote:

  
    
#
Use format() or formatC() to convert your numeric data to character
and then "call write.table on that."

e.g.
[1] "3.1415926536"

If this still is not clear to you, I give up, as I do not know how to
make it any clearer. Perhaps someone else can.

-- Bert
On Thu, Mar 7, 2013 at 4:24 PM, Marino David <davidmarino838 at gmail.com> wrote: