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

From: Prof Brian Ripley <ripley_at_stats.ox.ac.uk>
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,                  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

______________________________________________
R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
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 https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.