[Rd] One for the wish list - var.default etc

Prof Brian Ripley ripley at stats.ox.ac.uk
Wed May 9 13:00:14 CEST 2007

On Wed, 9 May 2007, S Ellison wrote:

> I was working on a permutation-like variant of the bootstrap for smaller 
> samples, and wanted to be able to get summary stats of my estimator 
> conveniently. mean() is OK as its a generic, so a mean.oddboot function 
> gets used automatically. But var, sd and others are not originally 
> written as generic; they have to be explicitly masked by a package or 
> new declaration.
> It would have been nice if stats::var was a generic to make it more 
> easily extensible... one for the wish list?

There is a reason: does your version have exactly the semantics of the 
function in stats (which does more than compute a variance)?  If we make
functions generic, we rely on package writers implementing the documented 
semantics (and that is not easy to check).  That was deemed to be too
easy to get wrong for var().

Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

More information about the R-devel mailing list