From clausen at econ.upenn.edu  Sat May 19 18:04:13 2007
From: clausen at econ.upenn.edu (Andrew Clausen)
Date: Sat, 19 May 2007 12:04:13 -0400
Subject: [Rd] relist, an inverse operator to unlist
In-Reply-To: <20070519153636.GJ21178@econ.upenn.edu>
References: <20070513172911.GP6923@econ.upenn.edu>
	<971536df0705131602p2e407fa2sd1d5e6984d2ffa56@mail.gmail.com>
	<20070514043240.GL28199@econ.upenn.edu>
	<971536df0705132354u6e2ae0cci9b1e42a766dc0ec5@mail.gmail.com>
	<17992.5499.383704.358418@stat.math.ethz.ch>
	<20070519153636.GJ21178@econ.upenn.edu>
Message-ID: <20070519160413.GK21178@econ.upenn.edu>

Hi all,

For reasons I can't explain, the code I posted worked in my session, but didn't
work when I started a fresh one.  standardGeneric() seems to get confused
by defaults for missing arguments.  It looks for a "missing" method with
this code:

	relist <- function(flesh, skeleton=attr(flesh, "skeleton"))
	{
		standardGeneric("relist")
	}

I uploaded yet another new version that adds a wrapper that seems to
resolve standardGeneric()'s confusion like this:

	relist <- function(flesh, skeleton=attr(flesh, "skeleton"))
	{
		# need a wrapper, since standardGeneric gets confused by
		# default arguments.
		f <- function(flesh, skeleton) standardGeneric("relist")

		f(flesh, skeleton)
	}

Cheers,
Andrew



[Rd] relist, an inverse operator to unlist
Andrew Clausen