From jago at mclink.it  Wed Feb  1 19:00:38 2006
From: jago at mclink.it (stefano iacus)
Date: Wed, 1 Feb 2006 19:00:38 +0100
Subject: [Rd] (no subject)
In-Reply-To: <6279E7D6-B12B-46B8-ADD2-D41570489753@mclink.it>
References: <6279E7D6-B12B-46B8-ADD2-D41570489753@mclink.it>
Message-ID: <8D52A513-21B4-44C1-AD3E-1D41E789C04B@mclink.it>

Apologizies, I forgot the subject.
Btw, I found it
stefano

Il giorno 01/feb/06, alle ore 18:25, stefano iacus ha scritto:

> Suppose X is a data.frame with n obs and k vars, all variables are
> factors.
>
> tab <- table(X)
>
> containes a k-dim array
>
> I would like to get a list from tab. This list is such that, each
> element contain the indexes corresponding to the observations which
> are in the same cell of this k-dim array. Of course, only for non
> empty cell.
>
> E.g.
>
>> set.seed(123)
>> X <- as.data.frame(matrix(rnorm(5000),100,5))
>> X$V1 <- cut(X$V1, br=5)
>> X$V2 <- cut(X$V2, br=5)
>> X$V3 <- cut(X$V3, br=5)
>> X$V4 <- cut(X$V4, br=5)
>> X$V5 <- cut(X$V5, br=5)
>> tab <- table(X)
>> which(tab>0) -> cells
>> length(cells)
> [1] 94
>
> thus, of course, 94 cells over 5^5 = 3125 are non empty.
> I would like a smart way (without reimplementing table/tabulate) to
> get the list of length 94 which contains the indexes of the obs in
> each cell
> Or, viceversa, a vector of length n which tells, observation by
> observation,  which cell (out of the 3125) the observation is in.
> stefano
>
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>



[Rd] (no subject)
stefano iacus