From maechler at stat.math.ethz.ch  Thu Aug 25 22:11:42 2016
From: maechler at stat.math.ethz.ch (Martin Maechler)
Date: Thu, 25 Aug 2016 22:11:42 +0200
Subject: [Rd] summary.default rounding on numeric seems inconsistent
	with other R behaviors
In-Reply-To: <A82891FC-7568-4D4C-8702-11D528BF7C40@win-vector.com>
References: <944E96FB-9C3B-46A3-9C57-8AF8EAA5284A@win-vector.com>
	<CANcXGiyBrz6d13POfJBLwgtLMUyYe40BwFMfVg0jzGVxY2aUXA@mail.gmail.com>
	<22455.13925.282926.46662@max.nulle.part>
	<22460.17078.724292.456732@stat.math.ethz.ch>
	<22461.27302.298978.16937@stat.math.ethz.ch>
	<A82891FC-7568-4D4C-8702-11D528BF7C40@win-vector.com>
Message-ID: <22463.20734.119370.752388@stat.math.ethz.ch>

>>>>> John Mount <jmount at win-vector.com>
>>>>>     on Wed, 24 Aug 2016 07:25:50 -0700 writes:

    >> On Aug 24, 2016, at 2:36 AM, Martin Maechler
    >> <maechler at stat.math.ethz.ch> wrote:
    >> 
    >>>>>>> 
    >> 
    >> [Talking to myself .. ;-)] Yes, but that's the tough part
    >> to change.
    >> 
    >> This thread's topic is really only about changing
    >> summary.default(), and I have started testing such a
    >> change now, and that does seem very sensible:
    >> 
    >> - No rounding in summary.default(), but - (almost)
    >> back-compatible rounding in its print() method.
    >> 
    >> My current plan is to commit this to R-devel in a day or
    >> so, unless unforeseen issues emerge.
    >> 
    >> Martin
    >> 

    > That is potentially a very good outcome.  Thank you so
    > much for producing and testing a patch.

I have now committed such a change to R-devel:

------------------------------------------------------------------------
r71150 | maechler | 2016-08-25 21:57:19 +0200 (Thu, 25 Aug 2016) | 1 line
Changed paths:
   M /trunk/doc/NEWS.Rd
   M /trunk/src/library/base/R/summary.R
   M /trunk/src/library/base/man/summary.Rd
   M /trunk/src/library/stats/R/ecdf.R
   M /trunk/tests/Examples/stats-Ex.Rout.save
   M /trunk/tests/reg-tests-2.Rout.save

summary.default() no longer rounds by default; just *prints* rounded
------------------------------------------------------------------------


I do expect quite a few packages giving slightly changed output,
typically uniformly not-worse one,  but just "typically".

Note that I did also have to patch   stats:::print.summary.ecdf()
because that had relied on the fact that summary(<numeric>) did
round itself already.
Other useR's code may need similar changes... and so this *is* a
user visible change, listed accordingly in NEWS (the above doc/NEWS.Rd in
the sources).

I hope very much that the overall and longer term benefit will
vastly outweigh the nuisance (to people publishing, e.g.) that
quite a few "basic" outputs will slightly change.

The benefit for maintainers and old timers like me will be that
we will not need to answer this (non-official) FAQ nor excuse a
peculiar behavior in the future .....
But yes, I expect a flurry of questions starting in April 2017,
and hope that the smart readers of this list will share the load
answering them .. ;-)


Martin Maechler
ETH Zurich



[Rd] summary.default rounding on numeric seems inconsistent with other R behaviors
Martin Maechler