From lawrence.michael at gene.com  Mon Jun 27 20:55:52 2016
From: lawrence.michael at gene.com (Michael Lawrence)
Date: Mon, 27 Jun 2016 11:55:52 -0700
Subject: [Rd] stack problem
In-Reply-To: <CAP01uRkHWezoiKQNbKCV6oCT9tqDiiQU5mzQO0iS_GCyEVMkLQ@mail.gmail.com>
References: <CAP01uRkHWezoiKQNbKCV6oCT9tqDiiQU5mzQO0iS_GCyEVMkLQ@mail.gmail.com>
Message-ID: <CAOQ5Nydf=F8BCPc3a2+JYmU28zUfy9zg32bfK2m7JX_RKCxgUg@mail.gmail.com>

I'll add the drop argument but I'm wondering about the order of the
levels. Should we set the levels to unique(names(x)) or sort them,
too?

On Mon, Jun 27, 2016 at 10:39 AM, Gabor Grothendieck
<ggrothendieck at gmail.com> wrote:
> stack() seems to drop empty levels.  Perhaps there could be a
> drop=FALSE argument if one wanted all the original levels.  In the
> example below, we may wish to retain level "b" in s$ind even though
> component LL$b has length 0.
>
>> LL <- list(a = 1:3, b = list())
>> s <- stack(LL)
>> str(s)
> 'data.frame':   3 obs. of  2 variables:
>  $ values: int  1 2 3
>  $ ind   : Factor w/ 1 level "a": 1 1 1
>
>
> --
> Statistics & Software Consulting
> GKX Group, GKX Associates Inc.
> tel: 1-877-GKX-GROUP
> email: ggrothendieck at gmail.com
>
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>



[Rd] stack problem
Michael Lawrence