Re: [R] How to merge string to DF

2007-08-24 Thread Stephen Tucker
This seems to work: tmp - aggregate(DF$y, list(DF$x, DF$f), mean) tmp2 - aggregate(DF$conc, list(DF$x, DF$f), paste,collapse=, ) names(tmp2)[3] - var1 final - merge(tmp,tmp2) --- Lauri Nikkinen [EMAIL PROTECTED] wrote: #Hi R-users, #I have an example DF like this: y1 - rnorm(10) + 6.8

[R] How to merge string to DF

2007-08-23 Thread Lauri Nikkinen
#Hi R-users, #I have an example DF like this: y1 - rnorm(10) + 6.8 y2 - rnorm(10) + (1:10*1.7 + 1) y3 - rnorm(10) + (1:10*6.7 + 3.7) y - c(y1,y2,y3) x - rep(1:3,10) f - gl(2,15, labels=paste(lev, 1:2, sep=)) g - seq(as.Date(2000/1/1), by=day, length=30) DF - data.frame(x=x,y=y, f=f, g=g) DF$wdays