Re: [R] simple data transformation question

2010-03-02 Thread Albert-Jan Roskam
. ~~ --- On Tue, 3/2/10, Henrique Dallazuanna wrote: From: Henrique Dallazuanna Subject: Re: [R] simple data transformation question To: "Albert-Jan Roskam" Cc: r-help@r-project.org Date: Tuesday, March 2, 2010, 2:45 PM Try this: reshape(cbind(id = as.numeric(dtf$var), dtf, time =  wit

Re: [R] simple data transformation question

2010-03-02 Thread Henrique Dallazuanna
Try this: reshape(cbind(id = as.numeric(dtf$var), dtf, time = with(dtf, ave(value, var, FUN = seq))), timevar="time", direction="wide") Or: xtabs(value ~ var + ave(value, var, FUN = seq), data = dtf) On Tue, Mar 2, 2010 at 9:40 AM, Albert-Jan Roskam wrote: > Hi all, > I have a (hopefully) si