On 5/23/07, hadley wickham <[EMAIL PROTECTED]> wrote:
> On 5/23/07, Gabor Grothendieck <[EMAIL PROTECTED]> wrote:
> > On 5/23/07, Martin Maechler <[EMAIL PROTECTED]> wrote:
> > > > "GaGr" == Gabor Grothendieck <[EMAIL PROTECTED]>
> > > > on Wed, 23 May 2007 08:56:50 -0400 writes:
> > >
On 5/23/07, Gabor Grothendieck <[EMAIL PROTECTED]> wrote:
> On 5/23/07, Martin Maechler <[EMAIL PROTECTED]> wrote:
> > > "GaGr" == Gabor Grothendieck <[EMAIL PROTECTED]>
> > > on Wed, 23 May 2007 08:56:50 -0400 writes:
> >
> >GaGr> On 5/23/07, Seth Falcon <[EMAIL PROTECTED]> wrote:
On 5/23/07, Martin Maechler <[EMAIL PROTECTED]> wrote:
> > "GaGr" == Gabor Grothendieck <[EMAIL PROTECTED]>
> > on Wed, 23 May 2007 08:56:50 -0400 writes:
>
>GaGr> On 5/23/07, Seth Falcon <[EMAIL PROTECTED]> wrote:
>>> Andrew Clausen <[EMAIL PROTECTED]> writes:
>>>
>>> >
> "GaGr" == Gabor Grothendieck <[EMAIL PROTECTED]>
> on Wed, 23 May 2007 08:56:50 -0400 writes:
GaGr> On 5/23/07, Seth Falcon <[EMAIL PROTECTED]> wrote:
>> Andrew Clausen <[EMAIL PROTECTED]> writes:
>>
>> > Hi Seth,
>> >
>> > On Mon, May 21, 2007 at 05:15:10PM
On 5/23/07, Seth Falcon <[EMAIL PROTECTED]> wrote:
> Andrew Clausen <[EMAIL PROTECTED]> writes:
>
> > 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 arg
Andrew Clausen <[EMAIL PROTECTED]> writes:
> 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
# returns list(a1 = 1, a2 = 2, b = 3) with an attribute
# "reshapeLong" containing skeleton (existing reshape also uses
# "reshapeWide" and "reshapeLong" attributes)
L <- list(a = 1:2, b = 3)
long <- reshape(L, direction = "long")
# returns original list but with an attribute "reshapeWide"
resha
Hi Gabor,
Can you suggest some examples of how your proposal could be used?
Reshape never returns a vector.
Cheers,
Andrew
On Tue, May 22, 2007 at 07:36:56PM -0400, Gabor Grothendieck wrote:
> One additional idea.
>
> I wonder if reshape might be promoted to a generic and relist made
> into met
One additional idea.
I wonder if reshape might be promoted to a generic and relist made
into methods for it. The unlisted version of an object would be the "long"
version and the original version of the list would be the "wide" version.
This would consolidate the two concepts together and make i
> "AndrewC" == Andrew Clausen <[EMAIL PROTECTED]>
> on Tue, 22 May 2007 07:51:54 -0400 writes:
AndrewC> Hi Seth,
AndrewC> 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
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 d
Hi Andrew,
Andrew Clausen <[EMAIL PROTECTED]> writes:
> 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 c
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(fle
Hi all,
I've written a new version of relist that includes the suggestions from Gabor
and Martin:
http://www.econ.upenn.edu/~clausen/computing/relist.R
The leading example now looks like this:
initial.param <- list(mean=c(0, 1), vcov=cbind(c(1, 1), c(1, 0)))
initial.para
Nice ideas, Gabor and Andrew.
While I agree with Andrew that such a utility makes for nicer
and considerably better maintainable code in examples like his,
and I do like to provide "inverse operator functions" in R
whenever sensible,
OTOH, we have strived to keep R's "base" package as lean and
cle
unlist would not attach a skeleton to every vector it returns, only
the relist method of unlist would. That way just that method needs
to be added and no changes to unlist itself are needed.
Before applying unlist to an object you would coerce the object to
class "relist" to force the relist met
Hi Gabor,
Thanks for the interesting suggestion. I must confess I got lost -- is
it something like this?
* unlist() could attach skeleton to every vector it returns.
* relist() could then use the skeleton attached to the vector to reconstruct
the object. The interface might be
relist
I suggest you define a "relist" class and then define an unlist
method for it which stores the skeleton as an attribute. Then
one would not have to specify skeleton in the relist command
so
relist(unlist(relist(x))) === x
1. relist(x) is the same as x except it gets an additional class "relist".
On Sun, May 13, 2007 at 01:29:11PM -0400, Andrew Clausen wrote:
> R has a function to convert complex objects into a vector
> representation. This file provides an inverse operation called "unlist" to
> convert vectors back to the convenient structural representation.
Oops. I meant to say:
R ha
19 matches
Mail list logo