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

From: Prof Brian Ripley <>
Date: Wed, 09 May 2007 12:00:14 +0100 (BST)

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,        
Professor of Applied Statistics,
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

______________________________________________ mailing list
Received on Wed 09 May 2007 - 11:03:17 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Wed 09 May 2007 - 11:33:54 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.