ID<-seq(1:18) # 18 participants
Group<-rep(1:3,each=6) # 3 parallel groups with 6 participants
set.seed(123) # allow for the random sample to be reproducible
Time01<-c(sample(1:200,18,replace=T)) # 18 measurements at first time point
Time02<-c(sample(50:250,18,replace=T)) # 18 measurements at second time point
Time03<-c(sample(100:300,18,replace=T)) # 18 measurements at third time point
df<-data.frame(ID,Group,Time01,Time02,Time03)
df$ID<-as.factor(df$ID)
df$Group<-factor(df$Group,levels=c(1,2,3),
labels=c("Group 01", "Group 02","Group 03"))
# convert into long format
DF<-tidyr::gather(df,Time,Measure,3:5)
DF$Time<-as.factor(DF$Time)
head(DF)