Re: [R] Row to Column help

2009-10-04 Thread AC Del Re
> > Wonderful, Phil! Your suggestion produced the exact format I desired. > Thank you kindly, > AC Del Re > > > On Sun, Oct 4, 2009 at 2:03 PM, Phil Spector wrote: > >> AC - >> The easiest way I can think of is to create a time variable, >> so reshape will know which observation to call 1, 2

Re: [R] Row to Column help

2009-10-04 Thread Phil Spector
AC - The easiest way I can think of is to create a time variable, so reshape will know which observation to call 1, 2, or 3. data$time = unlist(sapply(split(data,data$id),function(x)1:nrow(x))) or data$time = unlist(tapply(data$id,data$id,function(x)1:length(x)) Then reshape(data,idvar=c('id