[R] how to "singlify" entries

2005-05-30 Thread zhihua li
hi netters I have a rather simple question. I have a data frame with two variables X and Y, both of which are factors. X has 100 levels while Y has 10 levels only. The data frame has 100 rows in all, so for X the values are unique, and Y has many replicate values. Now I wanna reduce the data

Re: [R] how to "singlify" entries

2005-05-30 Thread Petr Pikal
Hallo On 30 May 2005 at 9:15, zhihua li wrote: > hi netters > > I have a rather simple question. I have a data frame with two Well, I do not understand you simple question fully. You have something like that dat<-data.frame(X=1:100, Y=sample(1:10,10)) dat$X<-factor(dat$X) dat$Y<-factor(dat$Y

Re: [R] how to "singlify" entries

2005-05-30 Thread Charles Plessy
On Mon, May 30, 2005 at 09:15:32AM +, zhihua li wrote : > hi netters > > I have a rather simple question. I have a data frame with two variables X > and Y, both of which are factors. X has 100 levels while Y has 10 levels > only. The data frame has 100 rows in all, so for X the values are u

Re: [R] how to "singlify" entries

2005-05-30 Thread Gabor Grothendieck
On 5/30/05, Charles Plessy <[EMAIL PROTECTED]> wrote: > On Mon, May 30, 2005 at 09:15:32AM +, zhihua li wrote : > > hi netters > > > > I have a rather simple question. I have a data frame with two variables X > > and Y, both of which are factors. X has 100 levels while Y has 10 levels > > only

Re: [R] how to "singlify" entries

2005-05-30 Thread Petr Pikal
On 30 May 2005 at 21:56, Charles Plessy wrote: > On Mon, May 30, 2005 at 09:15:32AM +, zhihua li wrote : > > hi netters > > > > I have a rather simple question. I have a data frame with two > > variables X and Y, both of which are factors. X has 100 levels while > > Y has 10 levels only. T

Re: [R] how to "singlify" entries

2005-05-30 Thread Charles Plessy
On Mon, May 30, 2005 at 09:09:27AM -0400, Gabor Grothendieck wrote : > Try using reshape, e.g. if dd is your data frame: > > reshape(dd, dir = "wide", idvar = "F1", timevar = "F2", > varying = list(c("VX","VY"))) Thank you very much, and to Petr Pikal too. Reshape is exactly what I had fo