[Rd] relist, an inverse operator to unlist
Andrew Clausen
clausen at econ.upenn.edu
Tue May 22 13:51:54 CEST 2007
Hi Seth,
On Mon, May 21, 2007 at 05:15:10PM -0700, Seth Falcon wrote:
> I will also add that the notion of a default argument on a generic
> function seems a bit odd to me. If an argument is available for
> dispatch, I just don't see what sense it makes to have a default. In
> those cases, the default should be handled by the method that has a
> signature with said argument matching the "missing" class.
>
> What often does make sense is to define a generic function where some
> argument are not available for dispatch. For example:
>
> setGeneric("foo", signature="flesh",
> function(flesh, skeleton=attr(flesh, "skeleton")
> standardGeneric("foo")))
That's an excellent suggestion. Thanks! However, I had to set the signature
to c("numeric", "missing") rather than just "numeric".
I have uploaded a new version here:
http://www.econ.upenn.edu/~clausen/computing/relist.R
Cheers,
Andrew
More information about the R-devel
mailing list