Re: [R] Data Manipulations - Group By equivalent

2006-07-02 Thread ronggui
use doBy package will be more easy. # GENERATE A TREATMENT GROUP # group-as.factor(paste(treatment, rep(1:2, 4), sep = '_')); # CREATE A SERIES OF RANDOM VALUES # x-rnorm(length(group)); # CREATE A DATA FRAME TO COMBINE THE ABOVE TWO # data-data.frame(group, x); library(doBy)

[R] Data Manipulations - Group By equivalent

2006-07-01 Thread zubin
Hello, a beginner R user - boy i wish there was a book on just data manipulations for SAS users learning R (equivalent to the SAS DATA STEP).. Okay, my question: I have a panel data set, hotel data occupancy by month for 12 months, 1000 hotels. I have a field labeled 'year' and want to

Re: [R] Data Manipulations - Group By equivalent

2006-07-01 Thread Frank E Harrell Jr
zubin wrote: Hello, a beginner R user - boy i wish there was a book on just data manipulations for SAS users learning R (equivalent to the SAS DATA STEP).. Okay, my question: I have a panel data set, hotel data occupancy by month for 12 months, 1000 hotels. I have a field labeled

Re: [R] Data Manipulations - Group By equivalent

2006-07-01 Thread Wensui Liu
Zubin, I bet you are working for intercontinental hotels and think you probably are not the real Zubin there. right? ^_^. If you have chance, could you please say hi to him for me? Here is a piece of R code I copy from my blog side by side with SAS. You might need to tweak it a little to get