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)
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
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
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