Skip to content
Prev 58121 / 63424 Next

dput()

Thanks guys, I guess I should have referred to FAQ 7.31 (which I am
indeed very familiar with) to avoid misunderstanding.  I have always
used dput() to clarify 7.31-type issues.

The description in ?dput implies [to me at any rate] that there will
be no floating-point roundoff in its output.  I hadn't realised that
'deparsing' as discussed in dput.Rd includes precision roundoff
issues.

I guess the question I should have asked is close to Ben's: "How to
force dput() to return an exact representation of a floating point
number?".  Duncan's reply is the insight I was missing: exact decimal
representation of a double might not be possible (this had not
occurred to me).  Also, Duncan's suggestion of control = c("all",
"hexNumeric") looks good and I will experiment with this.

Best wishes

Robin
On Sun, Mar 1, 2020 at 6:22 AM Duncan Murdoch <murdoch.duncan at gmail.com> wrote: